pub struct AuthenticatedClient {
pub read: OwnedReadHalf,
pub write: OwnedWriteHalf,
pub key: [u8; 32],
}Expand description
Represents a client that has been authenticated.
Fields§
§read: OwnedReadHalfThe read half of the TCP stream.
write: OwnedWriteHalfThe write half of the TCP stream.
key: [u8; 32]Implementations§
Source§impl AuthenticatedClient
impl AuthenticatedClient
Sourcepub fn is_alive(&self) -> bool
pub fn is_alive(&self) -> bool
Checks if the client connection is alive.
§Returns
bool-trueif the connection is alive,falseotherwise.
Sourcepub async fn terminate_connection(&mut self) -> Result<(), Error>
pub async fn terminate_connection(&mut self) -> Result<(), Error>
Terminates the connection of the client.
Sourcepub async fn insert(
&mut self,
collection: String,
data: Vec<u8>,
associated_data: Vec<u8>,
acl: Vec<String>,
usecases: Vec<String>,
) -> Result<String, Error>
pub async fn insert( &mut self, collection: String, data: Vec<u8>, associated_data: Vec<u8>, acl: Vec<String>, usecases: Vec<String>, ) -> Result<String, Error>
Inserts data into a specified collection.
§Arguments
collection- The name of the collection to insert the data into.data- The data to be inserted.associated_data- The associated data to be verified.acl- The access control list.usecases- The use cases associated with the data.
Sourcepub async fn insert_ope(
&mut self,
number_to_encrypt: f64,
acl: Vec<String>,
usecases: Vec<String>,
collection: String,
) -> Result<String, Error>
pub async fn insert_ope( &mut self, number_to_encrypt: f64, acl: Vec<String>, usecases: Vec<String>, collection: String, ) -> Result<String, Error>
Inserts a number into the database with Order Preserving Encryption (OPE).
§Arguments
number_to_encrypt- The number to be encrypted and inserted.acl- The access control list.usecases- The use cases associated with the data.collection- The name of the collection to insert the data into.
Sourcepub async fn query(&mut self, query: Query) -> Result<QueryResult, Error>
pub async fn query(&mut self, query: Query) -> Result<QueryResult, Error>
Queries the database and returns the results.
§Arguments
query- The query object representing the database query.
Sourcepub async fn modify(
&mut self,
id: String,
collection: String,
new_value: Vec<u8>,
) -> Result<Message, Error>
pub async fn modify( &mut self, id: String, collection: String, new_value: Vec<u8>, ) -> Result<Message, Error>
Modifies an existing document in the database.
§Arguments
id- The identifier of the document to be modified.collection- The name of the collection containing the document.new_value- The new value to be set in the document.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthenticatedClient
impl RefUnwindSafe for AuthenticatedClient
impl Send for AuthenticatedClient
impl Sync for AuthenticatedClient
impl Unpin for AuthenticatedClient
impl UnwindSafe for AuthenticatedClient
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
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> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.