pub struct RedDBClient {
pub addr: String,
/* private fields */
}Expand description
Thin authenticated client over the generated tonic stub.
Fields§
§addr: StringImplementations§
Source§impl RedDBClient
impl RedDBClient
pub async fn connect( addr: &str, token: Option<String>, ) -> Result<RedDBClient, Box<dyn Error>>
Sourcepub fn from_channel(
addr: String,
token: Option<String>,
channel: Channel,
) -> RedDBClient
pub fn from_channel( addr: String, token: Option<String>, channel: Channel, ) -> RedDBClient
Build on a caller-configured channel without enabling TLS in the generated-protocol crate’s otherwise transport-neutral feature set.
Sourcepub fn set_token(&mut self, token: String)
pub fn set_token(&mut self, token: String)
Update the bearer token, for example after a successful login.
pub async fn health_status(&mut self) -> Result<HealthReply, Box<dyn Error>>
pub async fn query_reply( &mut self, sql: &str, ) -> Result<QueryReply, Box<dyn Error>>
pub async fn query_reply_with_params( &mut self, sql: &str, params: Vec<QueryValue>, ) -> Result<QueryReply, Box<dyn Error>>
pub async fn query(&mut self, sql: &str) -> Result<String, Box<dyn Error>>
pub async fn collections(&mut self) -> Result<Vec<String>, Box<dyn Error>>
pub async fn scan( &mut self, collection: &str, limit: u64, ) -> Result<ScanReply, Box<dyn Error>>
pub async fn stats(&mut self) -> Result<StatsReply, Box<dyn Error>>
pub async fn create_row_entity( &mut self, collection: &str, json: &str, ) -> Result<EntityReply, Box<dyn Error>>
pub async fn create_row_typed( &mut self, collection: &str, fields: Vec<MutationField>, ) -> Result<EntityReply, Box<dyn Error>>
pub async fn bulk_create_rows( &mut self, collection: &str, payload_json: Vec<String>, ) -> Result<BulkEntityReply, Box<dyn Error>>
pub async fn explain(&mut self, sql: &str) -> Result<String, Box<dyn Error>>
pub async fn login( &mut self, username: &str, password: &str, ) -> Result<String, Box<dyn Error>>
pub async fn replication_status(&mut self) -> Result<String, Box<dyn Error>>
Sourcepub async fn topology(&mut self) -> Result<Vec<u8>, Box<dyn Error>>
pub async fn topology(&mut self) -> Result<Vec<u8>, Box<dyn Error>>
Fetch the canonical topology envelope bytes.
pub async fn topology_for_transport( &mut self, protocol: &str, ) -> Result<Vec<u8>, Box<dyn Error>>
pub async fn delete_entity( &mut self, collection: &str, id: u64, ) -> Result<OperationReply, Box<dyn Error>>
Trait Implementations§
Source§impl Clone for RedDBClient
impl Clone for RedDBClient
Source§fn clone(&self) -> RedDBClient
fn clone(&self) -> RedDBClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for RedDBClient
impl !RefUnwindSafe for RedDBClient
impl !UnwindSafe for RedDBClient
impl Forget for RedDBClient
impl Move for RedDBClient
impl Send for RedDBClientwhere
Arc<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>>: Send,
BoxRaw<dyn Future<Output = Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>> + Send>: Send,
Arc<Mutex<Option<ServiceError>>>: Send,
BoxRaw<ByteStr>: Send,
Bytes: Send,
RawVecInner: Send,
impl Sync for RedDBClientwhere
Arc<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>>: Sync,
ReusableBoxFuture<'static, Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>>: Sync,
Arc<Mutex<Option<ServiceError>>>: Sync,
BoxRaw<ByteStr>: Sync,
Bytes: Sync,
RawVecInner: Sync,
impl Unpin for RedDBClientwhere
Arc<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>>: Unpin,
Box<dyn Future<Output = Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>> + Send>: Unpin,
Arc<Mutex<Option<ServiceError>>>: Unpin,
Box<ByteStr>: Unpin,
*const u8: Unpin,
Align8<*mut ()>: Unpin,
&'static Vtable: Unpin,
*const u8 is !null: Unpin,
impl UnsafeUnpin for RedDBClientwhere
*const ArcInner<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>>>: UnsafeUnpin,
*const dyn Future<Output = Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>> + Send is !null: UnsafeUnpin,
PhantomData<dyn Future<Output = Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>> + Send>: UnsafeUnpin,
*const ArcInner<Mutex<Option<ServiceError>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<ServiceError>>>>: UnsafeUnpin,
*const ByteStr is !null: UnsafeUnpin,
PhantomData<ByteStr>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request