[][src]Struct bgp_rs::Reader

pub struct Reader<T, C> where
    T: Read,
    C: CapabilitiesRef
{ pub stream: T, pub capabilities: C, }

The BGPReader can read BGP messages from a BGP-formatted stream.

Fields

stream: T

The stream from which BGP messages will be read.

capabilities: C

Capability parameters that distinguish how BGP messages should be parsed.

Implementations

impl<T, C> Reader<T, C> where
    T: Read,
    C: CapabilitiesRef
[src]

pub fn read(&mut self) -> Result<(Header, Message), Error>[src]

Reads the next BGP message in the stream.

Panics

This function does not panic.

Errors

Any IO error will be returned while reading from the stream. If an ill-formatted stream provided behavior will be undefined.

Safety

This function does not make use of unsafe code.

impl<T> Reader<T, Capabilities> where
    T: Read
[src]

pub fn new(stream: T) -> Self where
    T: Read
[src]

Constructs a BGPReader with default parameters.

Panics

This function does not panic.

Errors

Any IO error will be returned while reading from the stream. If an ill-formatted stream provided behavior will be undefined.

Safety

This function does not make use of unsafe code.

Auto Trait Implementations

impl<T, C> RefUnwindSafe for Reader<T, C> where
    C: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, C> Send for Reader<T, C> where
    C: Send,
    T: Send

impl<T, C> Sync for Reader<T, C> where
    C: Sync,
    T: Sync

impl<T, C> Unpin for Reader<T, C> where
    C: Unpin,
    T: Unpin

impl<T, C> UnwindSafe for Reader<T, C> where
    C: UnwindSafe,
    T: UnwindSafe

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.