pub fn with_len(len: usize) -> Result<Self> {
        let mut s = Secret::new();

        if len > 0 {
            s.fd = memfd_secret()?;
            ftruncate(s.fd, len)?;
            s.ptr = mmap(s.fd, len)?;
            s.len = len;
        }

        Ok(s)
    }
/// Create a new Secret buffer with the given initial length. The given initial length can be
/// zero.
Create a new Secret buffer with the given initial length. The given initial length can be
zero.
Create a new Secret buffer with the given initial length . The given initial length can be zero .
pub fn with_len(len: usize) -> Result<Self> {
        let mut s = Secret::new();
        if len > 0 {
            s.fd = memfd_secret()?;
            ftruncate(s.fd, len)?;
            s.ptr = mmap(s.fd, len)?;
            s.len = len;
        }
        Ok(s)
    }
pub fn with_len ( len : usize ) -> Result < Self > { let mut s = Secret :: new ( ) ; if len > 0 { s . fd = memfd_secret ( ) ? ; ftruncate ( s . fd , len ) ? ; s . ptr = mmap ( s . fd , len ) ? ; s . len = len ; } Ok ( s ) }
Create a new Secret buffer with the given initial length.
Create a new Secret buffer with the given initial length .
len
usize
len
usize