pub struct ConnectionAsync<C: SqlExecutorAsync> { /* private fields */ }
Expand description
Same as Connection
but with an async executor.
Implementations§
Source§impl<C: SqlExecutorAsync> ConnectionAsync<C>
impl<C: SqlExecutorAsync> ConnectionAsync<C>
Sourcepub async fn new(connection: C, watcher: Arc<Watcher>) -> Result<Self, C::Error>
pub async fn new(connection: C, watcher: Arc<Watcher>) -> Result<Self, C::Error>
Create a new connection with connection
and watcher
.
See State::start_tracking()
for more information about initialization.
§Errors
Returns error if the initialization failed.
Sourcepub async fn sync_watcher_tables(&mut self) -> Result<(), C::Error>
pub async fn sync_watcher_tables(&mut self) -> Result<(), C::Error>
See Connection::sync_watcher_tables
for more details.
§Errors
Returns error if we failed to sync the changes to the database.
Sourcepub async fn publish_watcher_changes(&mut self) -> Result<(), C::Error>
pub async fn publish_watcher_changes(&mut self) -> Result<(), C::Error>
See Connection::publish_watcher_changes
for more details.
§Errors
Returns error if we failed to check for changes.
Sourcepub async fn stop_tracking(&mut self) -> Result<(), C::Error>
pub async fn stop_tracking(&mut self) -> Result<(), C::Error>
Sourcepub fn take(self) -> C
pub fn take(self) -> C
Consume the current connection and take ownership of the real sql connection.
§Remarks
This does not stop the tracking infrastructure enabled on the connection.
Use Self::stop_tracking()
to disable it first.
Trait Implementations§
Source§impl<C: SqlExecutorAsync> AsMut<C> for ConnectionAsync<C>
impl<C: SqlExecutorAsync> AsMut<C> for ConnectionAsync<C>
Source§impl<C: SqlExecutorAsync> AsRef<C> for ConnectionAsync<C>
impl<C: SqlExecutorAsync> AsRef<C> for ConnectionAsync<C>
Source§impl<C: SqlExecutorAsync> Deref for ConnectionAsync<C>
impl<C: SqlExecutorAsync> Deref for ConnectionAsync<C>
Source§impl<C: SqlExecutorAsync> DerefMut for ConnectionAsync<C>
impl<C: SqlExecutorAsync> DerefMut for ConnectionAsync<C>
Auto Trait Implementations§
impl<C> Freeze for ConnectionAsync<C>where
C: Freeze,
impl<C> !RefUnwindSafe for ConnectionAsync<C>
impl<C> Send for ConnectionAsync<C>
impl<C> Sync for ConnectionAsync<C>where
C: Sync,
impl<C> Unpin for ConnectionAsync<C>where
C: Unpin,
impl<C> !UnwindSafe for ConnectionAsync<C>
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