pub struct Container(/* private fields */);Implementations§
Source§impl Container
impl Container
Sourcepub async fn start(
cfg: Config,
auth: DesiredAuth,
params: Params,
) -> Result<Container>
pub async fn start( cfg: Config, auth: DesiredAuth, params: Params, ) -> Result<Container>
Start the container with the specified parameters. Initialization is performed on the calling task, and an error is returned if it fails. Once initialization is complete, the container continues to run on a background task, and errors are reported by log::error!.
Sourcepub async fn db(&self) -> Result<Db>
pub async fn db(&self) -> Result<Db>
Fetch the database associated with the container. You can perform any read operations you like on the database, however keep in mind that clients can write while you are reading. Transactions must be submitted to the main task to ensure some level of coordination between client writes and application transactions.
Sourcepub async fn commit(&self, txn: Txn) -> Result<()>
pub async fn commit(&self, txn: Txn) -> Result<()>
Submit a database transaction to be processed, wait for it to be accepted.
Sourcepub fn commit_unbounded(&self, txn: Txn) -> Result<()>
pub fn commit_unbounded(&self, txn: Txn) -> Result<()>
Submit a database transaction without waiting
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Container
impl !RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl !UnwindSafe for Container
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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