pub struct Channel {
pub opened: bool,
pub setup: bool,
pub initiator: bool,
pub xml_reader: XmlReader,
pub outbox: VecDeque<Vec<u8>>,
}Expand description
Communication channel between nodes in the propagation tree.
A Channel manages XML-based message exchange over a transport (typically
an SSH pipe). It uses an XmlReader for incoming messages and XML
generation for outgoing messages.
Fields§
§opened: boolWhether the channel has been opened (received StartMessage).
setup: boolWhether the channel setup is complete (received ACK to config).
initiator: boolWhether this end initiated the channel.
xml_reader: XmlReaderThe XML reader for parsing incoming data.
outbox: VecDeque<Vec<u8>>Outgoing message buffer.
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn feed(
&mut self,
data: &str,
) -> Result<Vec<Message>, MessageProcessingError>
pub fn feed( &mut self, data: &str, ) -> Result<Vec<Message>, MessageProcessingError>
Feed incoming data to the XML reader and return any parsed messages.
Sourcepub fn take_outgoing(&mut self) -> Option<Vec<u8>>
pub fn take_outgoing(&mut self) -> Option<Vec<u8>>
Take the next outgoing message from the outbox.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnsafeUnpin for Channel
impl UnwindSafe for Channel
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