pub struct Record { /* private fields */ }Expand description
The Record avro type. Avro records translates to a struct in Rust. Any struct that implements serde’s Serializable trait can be converted to an avro record.
Implementations§
Source§impl Record
impl Record
Sourcepub fn insert<T: Into<Value>>(
&mut self,
field_name: &str,
ty: T,
) -> Result<(), AvrowErr>
pub fn insert<T: Into<Value>>( &mut self, field_name: &str, ty: T, ) -> Result<(), AvrowErr>
Adds a field to the record.
Sourcepub fn set_field_order(
&mut self,
field_name: &str,
order: Order,
) -> Result<(), AvrowErr>
pub fn set_field_order( &mut self, field_name: &str, order: Order, ) -> Result<(), AvrowErr>
Sets the ordering of the field in the record.
Sourcepub fn from_btree<K: Into<String> + Ord + Display, V: Into<Value>>(
name: &str,
btree: BTreeMap<K, V>,
) -> Result<Self, AvrowErr>
pub fn from_btree<K: Into<String> + Ord + Display, V: Into<Value>>( name: &str, btree: BTreeMap<K, V>, ) -> Result<Self, AvrowErr>
Creates a record from a BTreeMap by consuming it.
The values in BTreeMap must implement Into<Value>. The name provided must match with the name in the record
schema being provided to the writer.
Trait Implementations§
impl StructuralPartialEq for Record
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
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