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>>
[src]
bytes: &'a [u8],
opts: BDecodeOpt
) -> BencodeParseResult<BencodeRef<'a>>
Decode the given bytes into a BencodeRef
using the given decode options.
fn buffer(&self) -> &'a [u8]
[src]
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
[src]
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
[src]
This method tests for !=
.
impl<'a> Clone for BencodeRef<'a>
[src]
fn clone(&self) -> BencodeRef<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Hash for BencodeRef<'a>
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a> BRefAccess for BencodeRef<'a>
[src]
type BKey = &'a [u8]
type BType = BencodeRef<'a>
fn kind<'b>(&'b self) -> BencodeRefKind<'b, &'a [u8], BencodeRef<'a>>
[src]
Access the bencode as a BencodeRefKind
.
fn str(&self) -> Option<&str>
[src]
Attempt to access the bencode as a str
.
fn int(&self) -> Option<i64>
[src]
Attempt to access the bencode as an i64
.
fn bytes(&self) -> Option<&[u8]>
[src]
Attempt to access the bencode as an [u8]
.
fn list(&self) -> Option<&BListAccess<BencodeRef<'a>>>
[src]
Attempt to access the bencode as an BListAccess
.
fn dict(&self) -> Option<&BDictAccess<&'a [u8], BencodeRef<'a>>>
[src]
Attempt to access the bencode as an BDictAccess
.