pub struct InMemoryFidlStorageFactory { /* private fields */ }Expand description
Storage that does not write to disk, for testing.
Implementations§
Source§impl InMemoryFidlStorageFactory
impl InMemoryFidlStorageFactory
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new InMemoryFidlStorageFactory with the ability to create a FidlStorage
that can only read and write to the storage keys passed in.
Sourcepub async fn initialize_storage<T>(&self)where
T: FidlStorageConvertible,
pub async fn initialize_storage<T>(&self)where
T: FidlStorageConvertible,
Helper method to simplify setup for InMemoryFidlStorageFactory in tests.
Trait Implementations§
Source§impl Default for InMemoryFidlStorageFactory
impl Default for InMemoryFidlStorageFactory
Source§impl StorageFactory for InMemoryFidlStorageFactory
impl StorageFactory for InMemoryFidlStorageFactory
Source§type Storage = FidlStorage
type Storage = FidlStorage
The storage type used to manage persisted data.
Source§async fn initialize<T>(&self) -> Result<(), Error>where
T: StorageAccess<Storage = FidlStorage>,
async fn initialize<T>(&self) -> Result<(), Error>where
T: StorageAccess<Storage = FidlStorage>,
Initialize the storage to be able to manage storage for objects of type T.
This will return an Error once
get_store is called the first time.Source§async fn initialize_with_loader<T, L>(&self, loader: L) -> Result<(), Error>
async fn initialize_with_loader<T, L>(&self, loader: L) -> Result<(), Error>
Initialize the storage to be able to manage storage for objects of type T.
This will return an Error once
get_store is called the first time.Source§async fn get_store(&self) -> Rc<FidlStorage>
async fn get_store(&self) -> Rc<FidlStorage>
Retrieve the store singleton instance.
Auto Trait Implementations§
impl !Freeze for InMemoryFidlStorageFactory
impl !RefUnwindSafe for InMemoryFidlStorageFactory
impl !Send for InMemoryFidlStorageFactory
impl !Sync for InMemoryFidlStorageFactory
impl Unpin for InMemoryFidlStorageFactory
impl UnsafeUnpin for InMemoryFidlStorageFactory
impl !UnwindSafe for InMemoryFidlStorageFactory
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]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