CommandCodec

Struct CommandCodec 

Source
#[non_exhaustive]
pub struct CommandCodec<const N: usize> {}
Available on crate feature framez only.
Expand description

Codec for encoding and decoding SMPP PDUs using Encoder and Decoder traits.

Implementations§

Source§

impl<const N: usize> CommandCodec<N>

Source

pub const fn new() -> Self

Trait Implementations§

Source§

impl<const N: usize> Debug for CommandCodec<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> DecodeError for CommandCodec<N>

Source§

type Error = DecodeError

The type of error that a decoder returns.
Source§

impl<'buf, const N: usize> Decoder<'buf> for CommandCodec<N>

Source§

type Item = Command<'buf, N>

The type of item that this decoder decodes.
Source§

fn decode( &mut self, src: &'buf mut [u8], ) -> Result<Option<(Self::Item, usize)>, Self::Error>

Decodes a frame from the provided buffer.
Source§

fn decode_eof( &mut self, src: &'buf mut [u8], ) -> Result<Option<(Self::Item, usize)>, Self::Error>

Decodes a frame from the provided buffer at the end of the stream.
Source§

impl<const N: usize> Default for CommandCodec<N>

Source§

fn default() -> Self

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

impl<'buf, const N: usize> Encoder<Command<'buf, N>> for CommandCodec<N>

Source§

type Error = EncodeError

The type of error that this encoder returns.
Source§

fn encode( &mut self, item: Command<'buf, N>, dst: &mut [u8], ) -> Result<usize, Self::Error>

Encodes an item into the provided buffer.

Auto Trait Implementations§

§

impl<const N: usize> Freeze for CommandCodec<N>

§

impl<const N: usize> RefUnwindSafe for CommandCodec<N>

§

impl<const N: usize> Send for CommandCodec<N>

§

impl<const N: usize> Sync for CommandCodec<N>

§

impl<const N: usize> Unpin for CommandCodec<N>

§

impl<const N: usize> UnwindSafe for CommandCodec<N>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more