Add Client::is_closed
This commit is contained in:
parent
633e87aefc
commit
b9e8b4868b
@ -60,6 +60,10 @@ impl Client {
|
||||
self.batch_execute("BEGIN")?;
|
||||
Ok(Transaction::new(self))
|
||||
}
|
||||
|
||||
pub fn is_closed(&self) -> bool {
|
||||
self.0.is_closed()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<tokio_postgres::Client> for Client {
|
||||
|
@ -98,6 +98,10 @@ impl Client {
|
||||
pub fn batch_execute(&mut self, query: &str) -> BatchExecute {
|
||||
BatchExecute(self.0.batch_execute(query))
|
||||
}
|
||||
|
||||
pub fn is_closed(&self) -> bool {
|
||||
self.0.is_closed()
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
|
@ -60,6 +60,10 @@ impl Client {
|
||||
}))
|
||||
}
|
||||
|
||||
pub fn is_closed(&self) -> bool {
|
||||
self.0.sender.is_closed()
|
||||
}
|
||||
|
||||
pub fn downgrade(&self) -> WeakClient {
|
||||
WeakClient(Arc::downgrade(&self.0))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user