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>
Methods available to all types of allocations.
impl<'a> DbAllocation<'a>
Methods available to all types of allocations.
Source§impl DbAllocation<'static>
Methods that produce new owned ('static
) allocations.
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> Freeze for DbAllocation<'a>
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