pub struct StringLiteral<const S: &'static str>;Expand description
Represents a string value that must be matched exactly when decoding this codec.
This is useful for representing enums with tag fields.
Trait Implementations§
Source§impl<const S: &'static str> Clone for StringLiteral<S>
impl<const S: &'static str> Clone for StringLiteral<S>
Source§impl<const S: &'static str, O: Ops> Codec<O> for StringLiteral<S>
impl<const S: &'static str, O: Ops> Codec<O> for StringLiteral<S>
Source§fn codec_read(ops: &O) -> ReadResult<Self>
fn codec_read(ops: &O) -> ReadResult<Self>
Convert from a data format to a data structure.
Source§fn codec_write(&self) -> WriteResult<O>
fn codec_write(&self) -> WriteResult<O>
Convert from a data structure to a data format.
type Incomplete = Result<Self, ReadError>
impl<const S: &'static str> Copy for StringLiteral<S>
Source§impl<const S: &'static str> Debug for StringLiteral<S>
impl<const S: &'static str> Debug for StringLiteral<S>
Source§impl<const S: &'static str> Default for StringLiteral<S>
impl<const S: &'static str> Default for StringLiteral<S>
impl<const S: &'static str> Eq for StringLiteral<S>
Source§impl<const S: &'static str> PartialEq for StringLiteral<S>
impl<const S: &'static str> PartialEq for StringLiteral<S>
impl<const S: &'static str> StructuralPartialEq for StringLiteral<S>
Auto Trait Implementations§
impl<const S: &'static str> Forget for StringLiteral<S>
impl<const S: &'static str> Freeze for StringLiteral<S>
impl<const S: &'static str> Move for StringLiteral<S>
impl<const S: &'static str> RefUnwindSafe for StringLiteral<S>
impl<const S: &'static str> Send for StringLiteral<S>
impl<const S: &'static str> Sync for StringLiteral<S>
impl<const S: &'static str> Unpin for StringLiteral<S>
impl<const S: &'static str> UnsafeUnpin for StringLiteral<S>
impl<const S: &'static str> UnwindSafe for StringLiteral<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.