Struct vmm_sys_util::fam::FamStructWrapper [−][src]
Expand description
Implementations
Create a new FamStructWrapper with num_elements
elements.
The elements will be zero-initialized. The type of the elements will be
FamStruct::Entry
.
Arguments
num_elements
- The number of elements in the FamStructWrapper.
Errors
When num_elements
is greater than the max possible len, it returns
Error::SizeLimitExceeded
.
Create a new FamStructWrapper from a slice of elements.
Arguments
entries
- The slice ofFamStruct::Entry
entries.
Errors
When the size of entries
is greater than the max possible len, it returns
Error::SizeLimitExceeded
.
Create a new FamStructWrapper from the raw content represented as Vec<T>
.
Sometimes we already have the raw content of an FAM struct represented as Vec<T>
,
and want to use the FamStructWrapper as accessors.
Arguments
content
- The raw content represented asVec[T]
.
Safety
This function is unsafe because the caller needs to ensure that the raw content is correctly layed out.
Consume the FamStructWrapper and return the raw content as Vec<T>
.
Get a reference to the actual FamStruct
instance.
Get a mut reference to the actual FamStruct
instance.
Get a pointer to the FamStruct
instance.
The caller must ensure that the fam_struct outlives the pointer this function returns, or else it will end up pointing to garbage.
Modifying the container referenced by this pointer may cause its buffer to be reallocated, which would also make any pointers to it invalid.
Get a mutable pointer to the FamStruct
instance.
The caller must ensure that the fam_struct outlives the pointer this function returns, or else it will end up pointing to garbage.
Modifying the container referenced by this pointer may cause its buffer to be reallocated, which would also make any pointers to it invalid.
Get the mutable elements slice.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for FamStructWrapper<T> where
T: RefUnwindSafe,
impl<T> Send for FamStructWrapper<T> where
T: Send,
impl<T> Sync for FamStructWrapper<T> where
T: Sync,
impl<T> Unpin for FamStructWrapper<T> where
T: Unpin,
impl<T> UnwindSafe for FamStructWrapper<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more