Enum vectorscan::database::alloc::DbAllocation
source · pub enum DbAllocation<'a> {
Misc(MiscAllocation),
Rust(Cow<'a, [u8]>),
}
Expand description
Wrapper over a misc or rust-level allocation.
Used to provide super::SerializedDb
with the ability to source data
allocated by the vectorscan library itself or by other Rust code.
Variants§
Misc(MiscAllocation)
Memory was allocated with a 'static
lifetime using the registered misc
allocator.
Rust(Cow<'a, [u8]>)
Memory was allocated with a known lifetime and may be owned or referenced.
Implementations§
source§impl<'a> DbAllocation<'a>
impl<'a> DbAllocation<'a>
Methods available to all types of allocations.
source§impl DbAllocation<'static>
impl DbAllocation<'static>
Methods that produce new owned ('static
) allocations.
A Clone
impl is also available for such owned allocations.
sourcepub fn from_cloned_data(s: &DbAllocation<'_>) -> Self
pub fn from_cloned_data(s: &DbAllocation<'_>) -> Self
Copy the referenced data into a new Rust-level'static
allocation.
Trait Implementations§
source§impl Clone for DbAllocation<'static>
impl Clone for DbAllocation<'static>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for DbAllocation<'a>
impl<'a> Send for DbAllocation<'a>
impl<'a> !Sync for DbAllocation<'a>
impl<'a> Unpin for DbAllocation<'a>
impl<'a> UnwindSafe for DbAllocation<'a>
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