Struct GlueSchemaUuidHeader

Source
pub struct GlueSchemaUuidHeader { /* private fields */ }
Expand description

HeaderBuilder based on Glue schema UUID

See the function docs for usage details

Implementations§

Source§

impl GlueSchemaUuidHeader

Source

pub fn from_uuid(schema_uuid: Uuid) -> Self

Create an instance of the struct from a Glue Schema UUID

Code for writing messages will most likely want to use this. You will need to determine via other means the correct Glue schema UUID and use it with this method to be able to create Avro-encoded messages with the correct headers.

Source

pub fn parse_from_raw_avro(message_payload: &[u8]) -> AvroResult<Self>

Create an instance of the struct based on parsing the UUID out of the header of a raw message

Code for reading messages will most likely want to use this. Once you receive the raw bytes of a message, use this function to build the struct from it. That struct can then be used with the below schema_uuid function to retrieve the UUID in order to retrieve the correct schema for the message. You can then use the raw message, the schema, and the struct instance to read the message.

Source

pub fn schema_uuid(&self) -> Uuid

Retrieve the UUID from the object

This is most useful in conjunction with the parse_from_raw_avro function to retrieve the actual UUID from the raw data of a received message.

Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V