pub struct DodbClient { /* private fields */ }Implementations§
Source§impl DodbClient
impl DodbClient
Sourcepub async fn connect(
bind_addr: SocketAddr,
server_addr: SocketAddr,
server_name: &str,
tenant: TenantId,
tls: ClientTlsConfig,
limits: ProtocolLimits,
) -> Result<Self, ClientError>
pub async fn connect( bind_addr: SocketAddr, server_addr: SocketAddr, server_name: &str, tenant: TenantId, tls: ClientTlsConfig, limits: ProtocolLimits, ) -> Result<Self, ClientError>
Opens a connection and returns a tenant-scoped handle.
New code serving multiple tenants should use DodbConnection::connect
once and call DodbConnection::for_tenant for each tenant.
pub async fn connect_with_endpoint( endpoint: Endpoint, server_addr: SocketAddr, server_name: &str, tenant: TenantId, tls: ClientTlsConfig, limits: ProtocolLimits, ) -> Result<Self, ClientError>
pub fn connection(&self) -> &DodbConnection
pub fn tenant(&self) -> TenantId
pub fn remote_addr(&self) -> SocketAddr
Sourcepub fn close(&self)
pub fn close(&self)
Releases this tenant handle without shutting down other handles.
Call DodbConnection::close on the shared connection when the
owner is ready to shut down the transport.
pub async fn get(&self, key: DocumentKey) -> Result<RevisionState, ClientError>
pub async fn put( &self, key: DocumentKey, value: Vec<u8>, ) -> Result<Revision, ClientError>
pub async fn delete(&self, key: DocumentKey) -> Result<Revision, ClientError>
pub async fn query( &self, pk: PrimaryKey, exclusive_after_sk: Option<SortKey>, limit: usize, ) -> Result<Vec<Document>, ClientError>
pub async fn scan( &self, exclusive_after_key: Option<DocumentKey>, limit: usize, ) -> Result<Vec<Document>, ClientError>
pub async fn transact( &self, request: TransactionRequest, ) -> Result<TransactionOutcome, ClientError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DodbClient
impl !UnwindSafe for DodbClient
impl Freeze for DodbClient
impl Send for DodbClient
impl Sync for DodbClient
impl Unpin for DodbClient
impl UnsafeUnpin for DodbClient
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