#[repr(u8)]pub enum StructMemoryKind {
Gc = 0,
Value = 1,
}Expand description
Represents the kind of memory management a struct uses.
Variants§
Gc = 0
A garbage collected struct is allocated on the heap and uses reference semantics when passed around.
Value = 1
A value struct is allocated on the stack and uses value semantics when passed around.
NOTE: When a value struct is used in an external API, a wrapper is created that pins the value on the heap. The heap-allocated value needs to be manually deallocated!
Trait Implementations§
Source§impl Clone for StructMemoryKind
impl Clone for StructMemoryKind
Source§fn clone(&self) -> StructMemoryKind
fn clone(&self) -> StructMemoryKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StructMemoryKind
impl Debug for StructMemoryKind
Source§impl Default for StructMemoryKind
impl Default for StructMemoryKind
Source§impl PartialEq for StructMemoryKind
impl PartialEq for StructMemoryKind
impl Copy for StructMemoryKind
impl Eq for StructMemoryKind
impl StructuralPartialEq for StructMemoryKind
Auto Trait Implementations§
impl Freeze for StructMemoryKind
impl RefUnwindSafe for StructMemoryKind
impl Send for StructMemoryKind
impl Sync for StructMemoryKind
impl Unpin for StructMemoryKind
impl UnwindSafe for StructMemoryKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more