pub struct AsyncSecureChannel { /* private fields */ }Expand description
Wrapper around an open secure channel
Implementations§
Source§impl AsyncSecureChannel
impl AsyncSecureChannel
Sourcepub fn request_handle(&self) -> u32
pub fn request_handle(&self) -> u32
Get the next request handle on the channel.
Sourcepub fn endpoint_info(&self) -> &EndpointInfo
pub fn endpoint_info(&self) -> &EndpointInfo
Get the target endpoint of the secure channel.
Sourcepub fn encoding_context(&self) -> &RwLock<RawRwLock, ContextOwned>
pub fn encoding_context(&self) -> &RwLock<RawRwLock, ContextOwned>
Get the current global encoding context in use by this channel.
Sourcepub fn set_auth_token(&self, token: NodeId)
pub fn set_auth_token(&self, token: NodeId)
Set the active authentication token for this channel.
Source§impl AsyncSecureChannel
impl AsyncSecureChannel
Sourcepub fn new(
certificate_store: Arc<RwLock<RawRwLock, CertificateStore>>,
endpoint_info: EndpointInfo,
session_retry_policy: SessionRetryPolicy,
ignore_clock_skew: bool,
auth_token: Arc<ArcSwapAny<Arc<NodeId>>>,
transport_config: TransportConfiguration,
channel_lifetime: u32,
encoding_context: Arc<RwLock<RawRwLock, ContextOwned>>,
) -> AsyncSecureChannel
pub fn new( certificate_store: Arc<RwLock<RawRwLock, CertificateStore>>, endpoint_info: EndpointInfo, session_retry_policy: SessionRetryPolicy, ignore_clock_skew: bool, auth_token: Arc<ArcSwapAny<Arc<NodeId>>>, transport_config: TransportConfiguration, channel_lifetime: u32, encoding_context: Arc<RwLock<RawRwLock, ContextOwned>>, ) -> AsyncSecureChannel
Create a new client secure channel.
Sourcepub async fn send(
&self,
request: impl Into<RequestMessage>,
timeout: Duration,
) -> Result<ResponseMessage, StatusCode>
pub async fn send( &self, request: impl Into<RequestMessage>, timeout: Duration, ) -> Result<ResponseMessage, StatusCode>
Send a message on the secure channel, and wait for a response.
Sourcepub async fn connect<T>(
&self,
connector: &T,
) -> Result<SecureChannelEventLoop<<T as Connector>::Transport>, StatusCode>where
T: Connector,
pub async fn connect<T>(
&self,
connector: &T,
) -> Result<SecureChannelEventLoop<<T as Connector>::Transport>, StatusCode>where
T: Connector,
Attempt to establish a connection using this channel, returning an event loop for polling the connection.
Sourcepub async fn connect_no_retry<T>(
&self,
connector: &T,
) -> Result<SecureChannelEventLoop<<T as Connector>::Transport>, StatusCode>where
T: Connector,
pub async fn connect_no_retry<T>(
&self,
connector: &T,
) -> Result<SecureChannelEventLoop<<T as Connector>::Transport>, StatusCode>where
T: Connector,
Connect to the server without attempting to retry if it fails.
Sourcepub async fn close_channel(&self)
pub async fn close_channel(&self)
Close the secure channel, optionally wait for the channel to close.
Auto Trait Implementations§
impl !Freeze for AsyncSecureChannel
impl !RefUnwindSafe for AsyncSecureChannel
impl Send for AsyncSecureChannel
impl Sync for AsyncSecureChannel
impl Unpin for AsyncSecureChannel
impl UnsafeUnpin for AsyncSecureChannel
impl !UnwindSafe for AsyncSecureChannel
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