pub struct RedWireClient { /* private fields */ }Implementations§
Source§impl RedWireClient
impl RedWireClient
pub async fn connect(opts: ConnectOptions) -> Result<Self>
pub async fn query(&mut self, sql: &str) -> Result<QueryResult>
Sourcepub async fn query_raw(&mut self, sql: &str) -> Result<String>
pub async fn query_raw(&mut self, sql: &str) -> Result<String>
Send a query and return the raw Result payload string. This is
used by the legacy red_client compatibility shim so the CLI
output stays byte-for-byte aligned with its old RedWire path.
pub async fn query_with( &mut self, sql: &str, params: &[Value], ) -> Result<QueryResult>
Sourcepub async fn insert(&mut self, collection: &str, payload: Value) -> Result<u64>
pub async fn insert(&mut self, collection: &str, payload: Value) -> Result<u64>
Insert a single row. payload is a JSON object with column
→ value pairs. Returns the engine’s affected-rows count.
Sourcepub async fn bulk_insert(
&mut self,
collection: &str,
payloads: Vec<Value>,
) -> Result<BulkInsertResult>
pub async fn bulk_insert( &mut self, collection: &str, payloads: Vec<Value>, ) -> Result<BulkInsertResult>
Bulk insert. Each entry in payloads is a JSON object.
Sourcepub async fn get(&mut self, collection: &str, id: &str) -> Result<Value>
pub async fn get(&mut self, collection: &str, id: &str) -> Result<Value>
Fetch one row by primary id. Returns the JSON envelope the
server emits on a Get frame: { ok, found, ... }.
Sourcepub async fn delete(&mut self, collection: &str, id: &str) -> Result<u64>
pub async fn delete(&mut self, collection: &str, id: &str) -> Result<u64>
Delete by primary id. Returns the affected count.
Sourcepub async fn bulk_insert_binary(
&mut self,
collection: &str,
columns: &[&str],
rows: &[Vec<BinaryValue>],
) -> Result<u64>
pub async fn bulk_insert_binary( &mut self, collection: &str, columns: &[&str], rows: &[Vec<BinaryValue>], ) -> Result<u64>
Bulk-insert via the binary fast path. Same wire shape as
MSG_BULK_INSERT_BINARY (0x06): typed values, no JSON
encode/decode. Use this for hot inserts where the column
types are known up front.
columns: column names in fixed order.
rows: each inner Vec must have one entry per column, in
column order. Mixed types are encoded by the value writer.
pub async fn ping(&mut self) -> Result<()>
pub async fn close(self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RedWireClient
impl !Sync for RedWireClient
impl !UnwindSafe for RedWireClient
impl Freeze for RedWireClient
impl Send for RedWireClient
impl Unpin for RedWireClient
impl UnsafeUnpin for RedWireClient
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
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>
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>
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>
T in a tonic::Request