pub struct Connection { /* private fields */ }
Expand description
A connection to a VedDB server
Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn connect(addr: impl Into<SocketAddr>) -> Result<Self>
pub async fn connect(addr: impl Into<SocketAddr>) -> Result<Self>
Create a new connection to the specified address
Sourcepub async fn connect_with_timeout(
addr: impl Into<SocketAddr>,
connect_timeout: Duration,
request_timeout: Duration,
) -> Result<Self>
pub async fn connect_with_timeout( addr: impl Into<SocketAddr>, connect_timeout: Duration, request_timeout: Duration, ) -> Result<Self>
Create a new connection with custom timeouts
Sourcepub async fn execute(&self, cmd: Command) -> Result<Response>
pub async fn execute(&self, cmd: Command) -> Result<Response>
Execute a command and return the response
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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