[−][src]Trait bendy::encoding::ToBencode
An object that can be encoded into a single bencode object
Associated Constants
const MAX_DEPTH: usize
The maximum depth that this object could encode to. Leaves do not consume a level, so an
i1e
has depth 0 and li1ee
has depth 1.
Required methods
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
Encode this object into the bencode stream
Provided methods
fn to_bencode(&self) -> Result<Vec<u8>, Error>
Encode this object to a byte string
Implementations on Foreign Types
impl<'a, E: 'a + ToBencode + Sized> ToBencode for &'a E
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<E: ToBencode> ToBencode for Box<E>
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<E: ToBencode> ToBencode for Rc<E>
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<E: ToBencode> ToBencode for Arc<E>
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<'a> ToBencode for &'a str
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for String
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for u8
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for u16
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for u32
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for u64
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for u128
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for usize
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for i8
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for i16
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for i32
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for i64
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for i128
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl ToBencode for isize
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<ContentT> ToBencode for Vec<ContentT> where
ContentT: ToBencode,
[src]
ContentT: ToBencode,
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<ContentT> ToBencode for VecDeque<ContentT> where
ContentT: ToBencode,
[src]
ContentT: ToBencode,
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<ContentT> ToBencode for LinkedList<ContentT> where
ContentT: ToBencode,
[src]
ContentT: ToBencode,
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<'a, ContentT> ToBencode for &'a [ContentT] where
ContentT: ToBencode,
[src]
ContentT: ToBencode,
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<K: AsRef<[u8]>, V: ToBencode> ToBencode for BTreeMap<K, V>
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<K, V, S> ToBencode for HashMap<K, V, S> where
K: AsRef<[u8]> + Eq + Hash,
V: ToBencode,
S: BuildHasher,
[src]
K: AsRef<[u8]> + Eq + Hash,
V: ToBencode,
S: BuildHasher,
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
Implementors
impl<'a> ToBencode for Value<'a>
[src]
const MAX_DEPTH: usize
[src]
fn encode(&self, encoder: SingleItemEncoder<'_>) -> Result<(), Error>
[src]
impl<I> ToBencode for AsString<I> where
I: AsRef<[u8]>,
[src]
I: AsRef<[u8]>,