Trait bip_bencode::BRefAccess
[−]
[src]
pub trait BRefAccess: Sized { type BKey; type BType: BRefAccess<BKey = Self::BKey>; fn kind<'a>(&'a self) -> BencodeRefKind<'a, Self::BKey, Self::BType>; fn str(&self) -> Option<&str>; fn int(&self) -> Option<i64>; fn bytes(&self) -> Option<&[u8]>; fn list(&self) -> Option<&BListAccess<Self::BType>>; fn dict(&self) -> Option<&BDictAccess<Self::BKey, Self::BType>>; }
Trait for read access to some bencode type.
Associated Types
type BKey
type BType: BRefAccess<BKey = Self::BKey>
Required Methods
fn kind<'a>(&'a self) -> BencodeRefKind<'a, Self::BKey, Self::BType>
Access the bencode as a BencodeRefKind
.
fn str(&self) -> Option<&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<&[u8]>
Attempt to access the bencode as an [u8]
.
fn list(&self) -> Option<&BListAccess<Self::BType>>
Attempt to access the bencode as an BListAccess
.
fn dict(&self) -> Option<&BDictAccess<Self::BKey, Self::BType>>
Attempt to access the bencode as an BDictAccess
.
Implementations on Foreign Types
impl<'a, T> BRefAccess for &'a T where
T: BRefAccess,
[src]
T: BRefAccess,
type BKey = T::BKey
type BType = T::BType
fn kind<'b>(&'b self) -> BencodeRefKind<'b, Self::BKey, Self::BType>
[src]
fn str(&self) -> Option<&str>
[src]
fn int(&self) -> Option<i64>
[src]
fn bytes(&self) -> Option<&[u8]>
[src]
fn list(&self) -> Option<&BListAccess<Self::BType>>
[src]
fn dict(&self) -> Option<&BDictAccess<Self::BKey, Self::BType>>
[src]
Implementors
impl<'a> BRefAccess for BencodeMut<'a> type BKey = Cow<'a, [u8]>; type BType = BencodeMut<'a>;
impl<'a> BRefAccess for BencodeRef<'a> type BKey = &'a [u8]; type BType = BencodeRef<'a>;