pub struct CtlConnection { /* private fields */ }Expand description
Controller end of one connection.
Implementations§
Source§impl CtlConnection
impl CtlConnection
Sourcepub fn new(stream: Box<dyn MeshStream>, local_node: impl Into<String>) -> Self
pub fn new(stream: Box<dyn MeshStream>, local_node: impl Into<String>) -> Self
Wrap an open stream to a target.
Sourcepub fn with_peer_verified(self, verified: bool) -> Self
pub fn with_peer_verified(self, verified: bool) -> Self
State that admission verified the peer on this stream. Only a caller that holds that evidence (a verified node connection) may set it.
Sourcepub async fn call(
&mut self,
dest: &str,
method: &str,
signed: &SignedCtl,
exchange: Option<&ArtifactExchange>,
timeout: Duration,
) -> Result<SignedCtl, CallError>
pub async fn call( &mut self, dest: &str, method: &str, signed: &SignedCtl, exchange: Option<&ArtifactExchange>, timeout: Duration, ) -> Result<SignedCtl, CallError>
Send one signed request to dest and wait for its correlated
response. Artifact frames that arrive meanwhile are served from
exchange (the target fetching the payload), if given.
Auto Trait Implementations§
impl !RefUnwindSafe for CtlConnection
impl !UnwindSafe for CtlConnection
impl Freeze for CtlConnection
impl Send for CtlConnection
impl Sync for CtlConnection
impl Unpin for CtlConnection
impl UnsafeUnpin for CtlConnection
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> 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 more