[][src]Enum torro::error::BencodeError

pub enum BencodeError {
    UnexpectedEOF,
    UnexpectedByte((usize, u8)),
    NoIntGiven(usize),
    InvalidInt(usize),
    NegativeZero(usize),
    LeadingZeros(usize),
    EmptyFile,
    MultipleValues,
}

Error enum for errors during parsing. If a usize is given, it typically represents last parsed byte's posision

Variants

UnexpectedEOF

When the file ends prematurely without stopping

UnexpectedByte((usize, u8))

A character has been placed in an unexpected area, this occurs commonly with integers that have a misc character. The first item in tuple represents placement and second represents the unexpected byte

NoIntGiven(usize)

An integer block was left empty, e.g. ie

InvalidInt(usize)

Integer contains invalid (not 0-9) characters

NegativeZero(usize)

A i-0e was given (negative zero) which is not allowed by the spec

LeadingZeros(usize)

Zeros where given before any significant number, e.g. i002e

EmptyFile

No bencode data given

MultipleValues

Bencode provided to bencode parser had multiple values given. Bencode is only allowed to have 1 toplevel value, if you'd like more, use a list or dict as the toplevel

Trait Implementations

impl Clone for BencodeError[src]

impl Debug for BencodeError[src]

impl From<BencodeError> for TorroError[src]

impl PartialEq<BencodeError> for BencodeError[src]

impl StructuralPartialEq for BencodeError[src]

Auto Trait Implementations

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.