Skip to main content

ProfileLoader

Struct ProfileLoader 

Source
pub struct ProfileLoader<M, S, C, P>
where M: Migrator<S, Profile<C>>, S: Versioned, P: Persistor<S>,
{ /* private fields */ }

Implementations§

Source§

impl<M, S, C, P> ProfileLoader<M, S, C, P>
where M: Migrator<S, Profile<C>>, S: Versioned, C: Default, P: Persistor<S>,

Source

pub async fn load( migrator: M, persistor: P, target_version: usize, ) -> Result<Self>

Source

pub async fn cloned(&self) -> C
where C: Clone,

Source

pub async fn version(&self) -> usize

Source

pub async fn get<T>(&self, f: impl FnOnce(&C) -> T) -> T

Source

pub async fn set(&self, f: impl FnOnce(&mut C)) -> Result<()>

Trait Implementations§

Source§

impl<M, S, C, P> Clone for ProfileLoader<M, S, C, P>
where M: Migrator<S, Profile<C>>, S: Versioned, P: Persistor<S>,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<M, S, C, P> !RefUnwindSafe for ProfileLoader<M, S, C, P>

§

impl<M, S, C, P> !UnwindSafe for ProfileLoader<M, S, C, P>

§

impl<M, S, C, P> Forget for ProfileLoader<M, S, C, P>

§

impl<M, S, C, P> Freeze for ProfileLoader<M, S, C, P>
where *const ArcInner<LoaderState<M, S, Profile<C>, P>> is !null: Freeze, PhantomData<ArcInner<LoaderState<M, S, Profile<C>, P>>>: Freeze,

§

impl<M, S, C, P> Move for ProfileLoader<M, S, C, P>

§

impl<M, S, C, P> Send for ProfileLoader<M, S, C, P>
where Arc<LoaderState<M, S, Profile<C>, P>>: Send,

§

impl<M, S, C, P> Sync for ProfileLoader<M, S, C, P>
where Arc<LoaderState<M, S, Profile<C>, P>>: Sync,

§

impl<M, S, C, P> Unpin for ProfileLoader<M, S, C, P>
where Arc<LoaderState<M, S, Profile<C>, P>>: Unpin,

§

impl<M, S, C, P> UnsafeUnpin for ProfileLoader<M, S, C, P>
where *const ArcInner<LoaderState<M, S, Profile<C>, P>> is !null: UnsafeUnpin, PhantomData<ArcInner<LoaderState<M, S, Profile<C>, P>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.