Struct bip_bencode::BencodeRef
[−]
[src]
pub struct BencodeRef<'a> { /* fields omitted */ }
BencodeRef
object that stores references to some buffer.
Methods
impl<'a> BencodeRef<'a>
[src]
fn decode(bytes: &'a [u8],
opts: BDecodeOpt)
-> BencodeParseResult<BencodeRef<'a>>
opts: BDecodeOpt)
-> BencodeParseResult<BencodeRef<'a>>
Decode the given bytes into a BencodeRef
using the given decode options.
fn buffer(&self) -> &'a [u8]
Get a byte slice of the current bencode byte representation.
Trait Implementations
impl<'a> Debug for BencodeRef<'a>
[src]
impl<'a> Eq for BencodeRef<'a>
[src]
impl<'a> PartialEq for BencodeRef<'a>
[src]
fn eq(&self, __arg_0: &BencodeRef<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &BencodeRef<'a>) -> bool
This method tests for !=
.
impl<'a> Clone for BencodeRef<'a>
[src]
fn clone(&self) -> BencodeRef<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'a> Hash for BencodeRef<'a>
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<'a> BRefAccess<'a> for BencodeRef<'a>
[src]
type BType = BencodeRef<'a>
fn kind<'b>(&'b self) -> BencodeRefKind<'b, 'a, BencodeRef<'a>>
Access the bencode as a BencodeRefKind
.
fn str(&self) -> Option<&'a str>
Attempt to access the bencode as a str
.
fn int(&self) -> Option<i64>
Attempt to access the bencode as an i64
.
fn bytes(&self) -> Option<&'a [u8]>
Attempt to access the bencode as an [u8]
.
fn list(&self) -> Option<&BListAccess<BencodeRef<'a>>>
Attempt to access the bencode as an BListAccess
.
fn dict(&self) -> Option<&BDictAccess<'a, BencodeRef<'a>>>
Attempt to access the bencode as an BDictAccess
.