Skip to main content

AuthenticatedFifo

Enum AuthenticatedFifo 

Source
pub enum AuthenticatedFifo {
    Sender {
        inner: Sender,
        peer_info: HandshakeMessage,
        is_server: bool,
    },
    Receiver {
        inner: Receiver,
        peer_info: HandshakeMessage,
        is_server: bool,
    },
}

Variants§

§

Sender

Fields

§inner: Sender
§is_server: bool
§

Receiver

Fields

§inner: Receiver
§is_server: bool

Implementations§

Source§

impl AuthenticatedFifo

Source

pub fn peer_info(&self) -> &HandshakeMessage

Get peer process information

Source

pub fn is_server(&self) -> bool

Check if this is the server side of the connection

Source

pub fn new_sender( sender: Sender, peer_info: HandshakeMessage, is_server: bool, ) -> Self

Create a new sender-based AuthenticatedFifo

Source

pub fn new_receiver( receiver: Receiver, peer_info: HandshakeMessage, is_server: bool, ) -> Self

Create a new receiver-based AuthenticatedFifo

Source

pub fn is_sender(&self) -> bool

Check if this is a sender

Source

pub fn is_receiver(&self) -> bool

Check if this is a receiver

Source

pub fn try_read(&mut self, buf: &mut [u8]) -> Result<usize>

Try to read data (non-blocking) - only works for Receiver

Source

pub fn try_write(&mut self, buf: &[u8]) -> Result<usize>

Try to write data (non-blocking) - only works for Sender

Source

pub async fn readable(&self) -> Result<()>

Wait for readiness - only works for appropriate variant

Source

pub async fn writable(&self) -> Result<()>

Wait for writable - only works for Sender

Source

pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Read some bytes from the FIFO (async) - only works for Receiver

Source

pub async fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>

Read exact number of bytes (async) - only works for Receiver

Source

pub async fn write(&mut self, buf: &[u8]) -> Result<usize>

Write some bytes to the FIFO (async) - only works for Sender

Source

pub async fn write_all(&mut self, buf: &[u8]) -> Result<()>

Write all bytes to the FIFO (async) - only works for Sender

Source

pub async fn write_str(&mut self, s: &str) -> Result<()>

Write a string - only works for Sender

Source

pub async fn write_line(&mut self, s: &str) -> Result<()>

Write a line (with newline) - only works for Sender

Trait Implementations§

Source§

impl Debug for AuthenticatedFifo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.