Trait BRefAccessExt

Source
pub trait BRefAccessExt<'a>: BRefAccess {
    // Required methods
    fn str_ext(&self) -> Option<&'a str>;
    fn bytes_ext(&self) -> Option<&'a [u8]>;
}
Expand description

Trait for extended read access to some bencode type.

Use this trait when you want to make sure that the lifetime of the underlying buffers is tied to the lifetime of the backing bencode buffer.

Required Methods§

Source

fn str_ext(&self) -> Option<&'a str>

Attempt to access the bencode as a str.

Source

fn bytes_ext(&self) -> Option<&'a [u8]>

Attempt to access the bencode as an [u8].

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a: 'b, 'b, T> BRefAccessExt<'a> for &'b T
where T: BRefAccessExt<'a>,

Source§

fn str_ext(&self) -> Option<&'a str>

Source§

fn bytes_ext(&self) -> Option<&'a [u8]>

Implementors§

Source§

impl<'a> BRefAccessExt<'a> for BencodeRef<'a>