pub struct Agent<PB: ProtocolBehavior> {
descriptor: AgentDescriptor,
put: Box<dyn Put<PB>>,
}
Expand description
An Agent
holds a non-cloneable reference to a Stream.
Fields§
§descriptor: AgentDescriptor
§put: Box<dyn Put<PB>>
Implementations§
source§impl<PB: ProtocolBehavior> Agent<PB>
impl<PB: ProtocolBehavior> Agent<PB>
pub fn new(descriptor: AgentDescriptor, put: Box<dyn Put<PB>>) -> Self
pub fn progress(&mut self) -> Result<(), Error>
pub fn reset(&mut self, new_name: AgentName) -> Result<(), Error>
sourcepub fn shutdown(&mut self) -> String
pub fn shutdown(&mut self) -> String
Shut down the agent by consuming it and returning a string that summarizes the execution.
sourcepub fn is_state_successful(&self) -> bool
pub fn is_state_successful(&self) -> bool
Checks whether the agent is in a good state.
sourcepub fn is_reusable_with(&self, other: &AgentDescriptor) -> bool
pub fn is_reusable_with(&self, other: &AgentDescriptor) -> bool
Checks whether the agent is reusable with the descriptor.
pub fn name(&self) -> AgentName
pub fn put(&self) -> &dyn Put<PB>
pub fn put_mut(&mut self) -> &mut dyn Put<PB>
Trait Implementations§
source§impl<PB: ProtocolBehavior> Debug for Agent<PB>
impl<PB: ProtocolBehavior> Debug for Agent<PB>
source§impl<PB: ProtocolBehavior> PartialEq for Agent<PB>
impl<PB: ProtocolBehavior> PartialEq for Agent<PB>
source§impl<PB: ProtocolBehavior> Stream<PB> for Agent<PB>
impl<PB: ProtocolBehavior> Stream<PB> for Agent<PB>
fn add_to_inbound(&mut self, message_flight: &PB::OpaqueProtocolMessageFlight)
source§fn take_message_from_outbound(
&mut self,
) -> Result<Option<PB::OpaqueProtocolMessageFlight>, Error>
fn take_message_from_outbound( &mut self, ) -> Result<Option<PB::OpaqueProtocolMessageFlight>, Error>
Takes a single TLS message from the outbound channel
Auto Trait Implementations§
impl<PB> Freeze for Agent<PB>
impl<PB> !RefUnwindSafe for Agent<PB>
impl<PB> !Send for Agent<PB>
impl<PB> !Sync for Agent<PB>
impl<PB> Unpin for Agent<PB>
impl<PB> !UnwindSafe for Agent<PB>
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
§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
The Resulting [
TupleList
], of an [Prepend::prepend()
] call,
including the prepended entry.