Struct dryoc::protected::Protected[][src]

pub struct Protected<A: Zeroize + Bytes, PM: ProtectMode, LM: LockMode> { /* fields omitted */ }
This is supported on crate feature nightly only.
Expand description

Holds Protected region of memory. Does not implement traits such as Copy, Clone, or std::fmt::Debug.

Trait Implementations

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Returns a reference to the underlying fixed-length byte array.

Returns a reference to the underlying fixed-length byte array.

Returns a reference to the underlying fixed-length byte array.

Returns a reference to the underlying fixed-length byte array.

Returns a slice of the underlying bytes.

Shorthand to retrieve the underlying length of the byte array.

Returns true if the array is empty.

Returns a slice of the underlying bytes.

Shorthand to retrieve the underlying length of the byte array.

Returns true if the array is empty.

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Executes the destructor for this type. Read more

Locks a region of memory, using mlock() on UNIX, or VirtualLock() on Windows. By default, the protect mode is set to ReadWrite (i.e., no exec) using mprotect() on UNIX, or VirtualProtect() on Windows. On Linux, it will also set MADV_DONTDUMP using madvise(). Read more

Returns a mutable reference to the underlying fixed-length byte array.

Returns a mutable reference to the underlying fixed-length byte array.

Returns a mutable slice to the underlying bytes.

Copies into the underlying slice from other. Panics if lengths do not match. Read more

Returns a new fixed-length byte array, initialized with zeroes.

Returns a new fixed-length byte array, filled with random values.

Returns an empty, unallocated, arbitrary-length byte array.

Returns an empty, unallocated, arbitrary-length byte array.

Protects an unlocked region of memory as no-access (and no exec), using mprotect() on UNIX, or VirtualProtect() on Windows. Read more

Protects a region of memory as read-only (and no exec), using mprotect() on UNIX, or VirtualProtect() on Windows. Read more

Protects a region of memory as read-write (and no exec), using mprotect() on UNIX, or VirtualProtect() on Windows. Read more

Resizes self with new_len elements, populating new values with value. Read more

Resizes self with new_len elements, populating new values with value. Read more

Unlocks a region of memory, using munlock() on UNIX, or VirtualLock() on Windows. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.