[][src]Enum torro::bencode::Bencode

pub enum Bencode {
    Dict(BTreeMap<Vec<u8>, Bencode>),
    List(Vec<Bencode>),
    ByteString(Vec<u8>),
    Int(i64),
}

A found bencode object whilst parsing, only one is returned from parse due to the bencode spec

Variants

Lexographically-ordered dictionary from d3:keyi6e9:other key12:second valuee.

The first value is equivilant to a Bencode::ByteString and second is a recursive Bencode block

List(Vec<Bencode>)

Variable-sized array (list) of further Bencodes from l4:this2:is1:a4:liste

ByteString(Vec<u8>)

A bytestring containing multiple bytes from 11:string here

Int(i64)

Parsed integer from a direct i0e

Implementations

impl Bencode[src]

pub fn dict(self) -> Option<BTreeMap<Vec<u8>, Bencode>>[src]

Bencode::Dict exposing method

pub fn list(self) -> Option<Vec<Bencode>>[src]

Bencode::List exposing method

pub fn bytestring(self) -> Option<Vec<u8>>[src]

Bencode::ByteString exposing method

pub fn int(self) -> Option<i64>[src]

Bencode::Int exposing method

Trait Implementations

impl Clone for Bencode[src]

impl Debug for Bencode[src]

impl PartialEq<Bencode> for Bencode[src]

impl StructuralPartialEq for Bencode[src]

Auto Trait Implementations

impl RefUnwindSafe for Bencode

impl Send for Bencode

impl Sync for Bencode

impl Unpin for Bencode

impl UnwindSafe for Bencode

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.