Struct bip_bencode::BencodeMut
[−]
[src]
pub struct BencodeMut<'a> { /* fields omitted */ }
BencodeMut
object that stores references to some data.
Methods
impl<'a> BencodeMut<'a>
[src]
fn new_int(value: i64) -> BencodeMut<'a>
[src]
Create a new BencodeMut
representing an i64
.
fn new_bytes(value: Cow<'a, [u8]>) -> BencodeMut<'a>
[src]
Create a new BencodeMut
representing a [u8]
.
fn new_list() -> BencodeMut<'a>
[src]
Create a new BencodeMut
representing a BListAccess
.
fn new_dict() -> BencodeMut<'a>
[src]
Create a new BencodeMut
representing a BDictAccess
.
fn encode(&self) -> Vec<u8>
[src]
Encode the BencodeMut
into a buffer representing the bencode.
Trait Implementations
impl<'a> Debug for BencodeMut<'a>
[src]
impl<'a> Eq for BencodeMut<'a>
[src]
impl<'a> PartialEq for BencodeMut<'a>
[src]
fn eq(&self, __arg_0: &BencodeMut<'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: &BencodeMut<'a>) -> bool
[src]
This method tests for !=
.
impl<'a> Clone for BencodeMut<'a>
[src]
fn clone(&self) -> BencodeMut<'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 BencodeMut<'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 BencodeMut<'a>
[src]
type BKey = Cow<'a, [u8]>
type BType = BencodeMut<'a>
fn kind<'b>(&'b self) -> BencodeRefKind<'b, Cow<'a, [u8]>, BencodeMut<'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<BencodeMut<'a>>>
[src]
Attempt to access the bencode as an BListAccess
.
fn dict(&self) -> Option<&BDictAccess<Cow<'a, [u8]>, BencodeMut<'a>>>
[src]
Attempt to access the bencode as an BDictAccess
.
impl<'a> BMutAccess for BencodeMut<'a>
[src]
fn kind_mut<'b>(
&'b mut self
) -> BencodeMutKind<'b, Cow<'a, [u8]>, BencodeMut<'a>>
[src]
&'b mut self
) -> BencodeMutKind<'b, Cow<'a, [u8]>, BencodeMut<'a>>
Access the bencode as a BencodeMutKind
.
fn list_mut(&mut self) -> Option<&mut BListAccess<BencodeMut<'a>>>
[src]
Attempt to access the bencode as a mutable BListAccess
.
fn dict_mut(
&mut self
) -> Option<&mut BDictAccess<Cow<'a, [u8]>, BencodeMut<'a>>>
[src]
&mut self
) -> Option<&mut BDictAccess<Cow<'a, [u8]>, BencodeMut<'a>>>
Attempt to access the bencode as a mutable BDictAccess
.