[][src]Struct cjdns_sniff::Sniffer

pub struct Sniffer { /* fields omitted */ }

Wraps connection to cjdns admin interface and allows to send and receive messages of a certain type.

Implementations

impl Sniffer[src]

pub async fn sniff_traffic(
    conn: Connection,
    content_type: ContentType
) -> Result<Self, ConnectError>
[src]

Create new Sniffer instance by connecting to a cjdns node.

pub async fn send<'_, '_>(
    &'_ mut self,
    msg: Message,
    dest: Option<&'_ str>
) -> Result<(), SendError>
[src]

Send a message. Destination is an optional argument, if None, localhost is used.

pub async fn receive<'_>(&'_ mut self) -> Result<Message, ReceiveError>[src]

Receive a message.

pub async fn disconnect<'_>(&'_ mut self) -> Result<(), ConnectError>[src]

Disconnect from cjdns router. Failing to do so would result in a stale UDP connection on router side. Though, this connection will be automatically reused on next connect.

Auto Trait Implementations

impl !RefUnwindSafe for Sniffer

impl Send for Sniffer

impl Sync for Sniffer

impl Unpin for Sniffer

impl !UnwindSafe for Sniffer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,