StaticPutRequestCacher

Struct StaticPutRequestCacher 

Source
pub struct StaticPutRequestCacher<const BUF_SIZE: usize> {
    pub static_fields: StaticPutRequestFields,
    /* private fields */
}
Expand description

This is a put request cache structure which can be used to cache ReadablePutRequests without requiring run-time allocation. The user must specify the static buffer sizes used to store TLVs or list of TLVs.

Fields§

§static_fields: StaticPutRequestFields

Implementations§

Source§

impl<const BUF_SIZE: usize> StaticPutRequestCacher<BUF_SIZE>

Source

pub fn new() -> Self

Source

pub fn set( &mut self, put_request: &impl ReadablePutRequest, ) -> Result<(), ByteConversionError>

Source

pub fn has_source_file(&self) -> bool

Source

pub fn has_dest_file(&self) -> bool

Source

pub fn source_file(&self) -> Result<&str, Utf8Error>

Source

pub fn dest_file(&self) -> Result<&str, Utf8Error>

Source

pub fn opts_len(&self) -> usize

Source

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

Source

pub fn clear(&mut self)

This clears the cacher structure. This is a cheap operation because it only sets Optional values to None and the length of stores TLVs to 0.

Please note that this method will not set the values in the buffer to 0.

Trait Implementations§

Source§

impl<const BUF_SIZE: usize> Default for StaticPutRequestCacher<BUF_SIZE>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<const BUF_SIZE: usize> Freeze for StaticPutRequestCacher<BUF_SIZE>

§

impl<const BUF_SIZE: usize> RefUnwindSafe for StaticPutRequestCacher<BUF_SIZE>

§

impl<const BUF_SIZE: usize> Send for StaticPutRequestCacher<BUF_SIZE>

§

impl<const BUF_SIZE: usize> Sync for StaticPutRequestCacher<BUF_SIZE>

§

impl<const BUF_SIZE: usize> Unpin for StaticPutRequestCacher<BUF_SIZE>

§

impl<const BUF_SIZE: usize> UnwindSafe for StaticPutRequestCacher<BUF_SIZE>

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.