Expand description
Tag for a Tdf value. This contains the String tag for naming the field and then the type of the field
Tuple Fields
0: String
1: ValueType
Implementations
sourceimpl Tag
impl Tag
sourcepub fn expect_tag(
tag: &'static str,
value_type: &ValueType,
reader: &mut Reader<'_>
) -> CodecResult<Tag>
pub fn expect_tag(
tag: &'static str,
value_type: &ValueType,
reader: &mut Reader<'_>
) -> CodecResult<Tag>
Reads through the provided reader until a tag with the provided tag and value type is met returning null if no more tags were found or the tag was found but was not of the right type
sourcepub fn take_two(reader: &mut Reader<'_>) -> CodecResult<()>
pub fn take_two(reader: &mut Reader<'_>) -> CodecResult<()>
Tries to take a byte from the front checking if its a two and stepping back if the value isn’t two
sourcepub fn discard_group(reader: &mut Reader<'_>) -> CodecResult<()>
pub fn discard_group(reader: &mut Reader<'_>) -> CodecResult<()>
Discards any remaining tags in the group to exhaust the remaining bytes until the group ending byte
sourcepub fn discard_tag(reader: &mut Reader<'_>) -> CodecResult<()>
pub fn discard_tag(reader: &mut Reader<'_>) -> CodecResult<()>
Discards the next tag and all of its contents
sourcepub fn discard_type(ty: &ValueType, reader: &mut Reader<'_>) -> CodecResult<()>
pub fn discard_type(ty: &ValueType, reader: &mut Reader<'_>) -> CodecResult<()>
Discards the provided type of value
sourcepub fn encode_from(tag: &str, value_type: &ValueType, output: &mut Vec<u8>)
pub fn encode_from(tag: &str, value_type: &ValueType, output: &mut Vec<u8>)
Encodes a tag directly using the provided values
sourcepub fn encode_tag(tag: &str, output: &mut Vec<u8>)
pub fn encode_tag(tag: &str, output: &mut Vec<u8>)
Encodes the provided tag into its byte form and appends it to the provided output vec
Trait Implementations
sourceimpl Codec for Tag
impl Codec for Tag
sourcefn encode(&self, output: &mut Vec<u8>)
fn encode(&self, output: &mut Vec<u8>)
Function for implementing encoding of Self to the
provided vec of bytes Read more
sourcefn decode(reader: &mut Reader<'_>) -> CodecResult<Self>
fn decode(reader: &mut Reader<'_>) -> CodecResult<Self>
Function for implementing decoding of Self from
the provided Reader. Will return None if self
cannot be decoded Read more
sourcefn skip(reader: &mut Reader<'_>) -> CodecResult<()>
fn skip(reader: &mut Reader<'_>) -> CodecResult<()>
Function to provide functionality for skipping this
data type (e.g. read the bytes without using them) Read more
sourcefn value_type() -> ValueType
fn value_type() -> ValueType
Optional additional specifier for Tdf types that
tells which type this is Read more
sourcefn encode_bytes(&self) -> Vec<u8>
fn encode_bytes(&self) -> Vec<u8>
Shortcut function for encoding self directly to
a Vec of bytes Read more
impl Eq for Tag
impl StructuralEq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more