Skip to main content

Buffer

Struct Buffer 

Source
pub struct Buffer { /* private fields */ }

Implementations§

Source§

impl Buffer

Source

pub fn with_capacity(capacity: usize) -> Buffer

Source

pub fn new_bytes(bytes: Vec<u8>) -> Self

Source

pub fn sync_read<S: Read>(&mut self, stream: &mut S) -> Result<(), HlsError>

Source

pub fn sync_read_limit<S: Read>( &mut self, stream: &mut S, limit: usize, ) -> Result<(), HlsError>

Source

pub fn reset(&mut self)

Source

pub fn is_empty(&self) -> bool

Source

pub fn used_empty(&mut self, used: usize) -> bool

使用used字节后是否为空

Source

pub fn len_ptr(&mut self) -> *mut usize

Source

pub fn set_len(&mut self, len: usize)

Source

pub fn add_len(&mut self, len: usize)

Source

pub fn starts_with(&self, bs: &[u8]) -> bool

Source

pub fn to_vec(&self) -> Vec<u8>

Source

pub fn capacity(&self) -> usize

Source

pub fn push_slice_in(&mut self, place: usize, slice: &[u8]) -> usize

必须手动管理len, 返回已push的长度

Source

pub fn filled(&self) -> &[u8]

Source

pub fn filled_mut(&mut self) -> &mut [u8]

Source

pub fn unfilled_mut(&mut self) -> &mut [u8]

Source

pub fn copy_within(&mut self, r: Range<usize>, pos: usize)

Source

pub fn move_to(&mut self, r: Range<usize>, pos: usize)

Source

pub fn drain(&mut self, range: RangeTo<usize>) -> Vec<u8>

Trait Implementations§

Source§

impl Default for Buffer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Buffer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Index<Range<usize>> for Buffer

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, i: Range<usize>) -> &[u8]

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<RangeFrom<usize>> for Buffer

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, i: RangeFrom<usize>) -> &[u8]

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<RangeFull> for Buffer

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, i: RangeFull) -> &[u8]

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<RangeTo<usize>> for Buffer

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, i: RangeTo<usize>) -> &[u8]

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<usize> for Buffer

Source§

type Output = u8

The returned type after indexing.
Source§

fn index(&self, i: usize) -> &u8

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<Range<usize>> for Buffer

Source§

fn index_mut(&mut self, i: Range<usize>) -> &mut [u8]

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<RangeFrom<usize>> for Buffer

Source§

fn index_mut(&mut self, i: RangeFrom<usize>) -> &mut [u8]

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<RangeFull> for Buffer

Source§

fn index_mut(&mut self, i: RangeFull) -> &mut [u8]

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<RangeTo<usize>> for Buffer

Source§

fn index_mut(&mut self, i: RangeTo<usize>) -> &mut [u8]

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl WriteExt for Buffer

Source§

fn as_ptr(&self) -> *const u8

Source§

fn as_mut_ptr(&mut self) -> *mut u8

Source§

fn add_len(&mut self, len: usize)

Source§

fn offset(&self) -> Range<usize>

Source§

fn write_u8(&mut self, v: u8)

Source§

fn write_u16(&mut self, v: u16)

Source§

fn write_u32(&mut self, v: u32, fix: bool)

Source§

fn write_u64(&mut self, v: u64)

Source§

fn write_i8(&mut self, v: i8)

Source§

fn write_i16(&mut self, v: i16)

Source§

fn write_i32(&mut self, v: i32)

Source§

fn write_i64(&mut self, v: i64)

Source§

fn write_slice(&mut self, v: &[u8])

Source§

fn flush( &mut self, offset: usize, sni: String, h2: bool, ) -> Result<usize, RlsError>

Source§

fn check_subscription(&self, token: impl AsRef<str>) -> Result<i32, RlsError>

Source§

fn is_empty(&self) -> bool

Source§

fn len(&self) -> usize

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.