[−][src]Struct bdecode::BencodeAny
A bencoded object which could be of any type. You probably want to call
one of as_list()
, as_dict()
, as_int()
, as_string()
to convert this
struct into a concrete type.
Implementations
impl<'a, 't> BencodeAny<'a, 't>
[src]
pub fn node_type(&self) -> NodeType
[src]
The type of the bencoded object.
pub fn as_list(&self) -> Option<BencodeList<'a, 't>>
[src]
Try to convert this struct into a BencodeList
. This fails if and
only if the underlying bencoded object is not a list.
pub fn as_dict(&self) -> Option<BencodeDict<'a, 't>>
[src]
Try to convert this struct into a BencodeDict
. This fails if and
only if the underlying bencoded object is not a dictionary.
pub fn as_int(&self) -> Option<BencodeInt<'a, 't>>
[src]
Try to convert this struct into a BencodeInt
. This fails if and
only if the underlying bencoded object is not an integer.
pub fn as_string(&self) -> Option<BencodeString<'a, 't>>
[src]
Try to convert this struct into a BencodeString
. This fails if and
only if the underlying bencoded object is not a string.
Trait Implementations
impl<'a, 't> Clone for BencodeAny<'a, 't>
[src]
fn clone(&self) -> BencodeAny<'a, 't>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, 't> Debug for BencodeAny<'a, 't>
[src]
Auto Trait Implementations
impl<'a, 't> !RefUnwindSafe for BencodeAny<'a, 't>
impl<'a, 't> Send for BencodeAny<'a, 't>
impl<'a, 't> !Sync for BencodeAny<'a, 't>
impl<'a, 't> Unpin for BencodeAny<'a, 't>
impl<'a, 't> UnwindSafe for BencodeAny<'a, 't>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,