pub enum Bencode {
Dict(BTreeMap<Vec<u8>, Bencode>),
List(Vec<Bencode>),
ByteString(Vec<u8>),
Int(i64),
}Expand description
A found bencode object whilst parsing, only one is returned from parse due to the bencode spec
Variants§
Dict(BTreeMap<Vec<u8>, Bencode>)
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§
Source§impl Bencode
impl Bencode
Sourcepub fn bytestring(self) -> Option<Vec<u8>>
pub fn bytestring(self) -> Option<Vec<u8>>
Bencode::ByteString exposing method
Sourcepub fn int(self) -> Option<i64>
pub fn int(self) -> Option<i64>
Bencode::Int exposing method
Trait Implementations§
impl StructuralPartialEq for Bencode
Auto Trait Implementations§
impl Freeze for Bencode
impl RefUnwindSafe for Bencode
impl Send for Bencode
impl Sync for Bencode
impl Unpin for Bencode
impl UnsafeUnpin for Bencode
impl UnwindSafe for Bencode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more