pub struct Single<V>where
V: Serial,{ /* private fields */ }Expand description
Represents an entry in the database’s top level tree Can be used for singletons
Implementations§
Source§impl<V> Single<V>where
V: Serial,
impl<V> Single<V>where
V: Serial,
Sourcepub fn new<K>(db: Db, key: K) -> Result<Self>where
K: Serial,
pub fn new<K>(db: Db, key: K) -> Result<Self>where
K: Serial,
Creates a new singleton in a database from a key Represents an entry in that database
Sourcepub fn insert_owned(&self, value: V) -> Result<Option<V>>
pub fn insert_owned(&self, value: V) -> Result<Option<V>>
Inserts an owned value into the entry
Sourcepub fn insert_ref(&self, value: &V) -> Result<Option<V>>
pub fn insert_ref(&self, value: &V) -> Result<Option<V>>
Inserts a borrowed value into the entry
Auto Trait Implementations§
impl<V> Freeze for Single<V>
impl<V> !RefUnwindSafe for Single<V>
impl<V> Send for Single<V>
impl<V> Sync for Single<V>
impl<V> Unpin for Single<V>where
V: Unpin,
impl<V> !UnwindSafe for Single<V>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.