[][src]Struct bdecode::BencodeAny

pub struct BencodeAny<'a, 't> { /* fields omitted */ }

A bencoded object which could be of any type. You probably want to call one of as_list(), as_dict(), as_int(), as_string() to convert this struct into a concrete type.

Implementations

impl<'a, 't> BencodeAny<'a, 't>[src]

pub fn node_type(&self) -> NodeType[src]

The type of the bencoded object.

pub fn as_list(&self) -> Option<BencodeList<'a, 't>>[src]

Try to convert this struct into a BencodeList. This fails if and only if the underlying bencoded object is not a list.

pub fn as_dict(&self) -> Option<BencodeDict<'a, 't>>[src]

Try to convert this struct into a BencodeDict. This fails if and only if the underlying bencoded object is not a dictionary.

pub fn as_int(&self) -> Option<BencodeInt<'a, 't>>[src]

Try to convert this struct into a BencodeInt. This fails if and only if the underlying bencoded object is not an integer.

pub fn as_string(&self) -> Option<BencodeString<'a, 't>>[src]

Try to convert this struct into a BencodeString. This fails if and only if the underlying bencoded object is not a string.

Trait Implementations

impl<'a, 't> Clone for BencodeAny<'a, 't>[src]

impl<'a, 't> Debug for BencodeAny<'a, 't>[src]

Auto Trait Implementations

impl<'a, 't> !RefUnwindSafe for BencodeAny<'a, 't>

impl<'a, 't> Send for BencodeAny<'a, 't>

impl<'a, 't> !Sync for BencodeAny<'a, 't>

impl<'a, 't> Unpin for BencodeAny<'a, 't>

impl<'a, 't> UnwindSafe for BencodeAny<'a, 't>

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.