pub struct ConnectionStream {
pub addy: Option<String>,
pub protocol: Proto,
pub tcp_stream: Option<Box<TcpStream>>,
pub unix_stream: Option<Box<UnixStream>>,
}Expand description
Represents an open connection to the keystore.
Fields§
§addy: Option<String>§protocol: Proto§tcp_stream: Option<Box<TcpStream>>§unix_stream: Option<Box<UnixStream>>Implementations§
Source§impl ConnectionStream
impl ConnectionStream
Sourcepub async fn new_tcp_connection(addy: String) -> Result<Self, ErrorArrayItem>
pub async fn new_tcp_connection(addy: String) -> Result<Self, ErrorArrayItem>
Create a new TCP connection to the keystore server.
Sourcepub async fn new_unix_connection() -> Result<Self, ErrorArrayItem>
pub async fn new_unix_connection() -> Result<Self, ErrorArrayItem>
Create a new Unix domain socket connection to the keystore server.
Sourcepub async fn ensure_connection(&mut self) -> Result<Self, ErrorArrayItem>
pub async fn ensure_connection(&mut self) -> Result<Self, ErrorArrayItem>
Ensure the internal connection is alive, reconnecting if necessary.
Sourcepub fn get_stream_mut(&mut self) -> StreamMut<'_>
pub fn get_stream_mut(&mut self) -> StreamMut<'_>
Obtain a mutable reference to the underlying stream regardless of the protocol.
Sourcepub fn get_protocol(&self) -> Proto
pub fn get_protocol(&self) -> Proto
Return the protocol associated with this connection.
Auto Trait Implementations§
impl Freeze for ConnectionStream
impl RefUnwindSafe for ConnectionStream
impl Send for ConnectionStream
impl Sync for ConnectionStream
impl Unpin for ConnectionStream
impl UnwindSafe for ConnectionStream
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> 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> 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