Struct SingleObject

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

A simplified container of data. Can be used to produce a set of properties and be merged into a data set later, or be serialized by itself. Still support schema migration.

Implementations§

Source§

impl SingleObject

Source

pub fn new(schema: &SchemaRecord) -> SingleObject

Source

pub fn restore( schema_set: &SchemaSet, schema: SchemaFingerprint, properties: HashMap<String, Value, RandomState>, property_null_overrides: HashMap<String, NullOverride, RandomState>, dynamic_collection_entries: HashMap<String, OrderedSet<Uuid>, RandomState>, ) -> SingleObject

Source

pub fn schema(&self) -> &SchemaRecord

Source

pub fn properties(&self) -> &HashMap<String, Value, RandomState>

Source

pub fn property_null_overrides( &self, ) -> &HashMap<String, NullOverride, RandomState>

Source

pub fn dynamic_collection_entries( &self, ) -> &HashMap<String, OrderedSet<Uuid>, RandomState>

Source

pub fn get_null_override( &self, schema_set: &SchemaSet, path: impl AsRef<str>, ) -> Result<NullOverride, DataSetErrorWithBacktrace>

Gets if the property has a null override associated with it An error will be returned if the schema doesn’t exist or if this field is not nullable

Source

pub fn set_null_override( &mut self, schema_set: &SchemaSet, path: impl AsRef<str>, null_override: NullOverride, ) -> Result<(), DataSetErrorWithBacktrace>

Source

pub fn resolve_null_override( &self, schema_set: &SchemaSet, path: impl AsRef<str>, ) -> Result<NullOverride, DataSetErrorWithBacktrace>

Source

pub fn has_property_override(&self, path: impl AsRef<str>) -> bool

Source

pub fn get_property_override(&self, path: impl AsRef<str>) -> Option<&Value>

Source

pub fn set_property_override( &mut self, schema_set: &SchemaSet, path: impl AsRef<str>, value: Option<Value>, ) -> Result<Option<Value>, DataSetErrorWithBacktrace>

Source

pub fn resolve_property<'a>( &'a self, schema_set: &'a SchemaSet, path: impl AsRef<str>, ) -> Result<&'a Value, DataSetErrorWithBacktrace>

Source

pub fn get_dynamic_array_entries( &self, schema_set: &SchemaSet, path: impl AsRef<str>, ) -> Result<Iter<'_, Uuid>, DataSetErrorWithBacktrace>

Source

pub fn get_map_entries( &self, schema_set: &SchemaSet, path: impl AsRef<str>, ) -> Result<Iter<'_, Uuid>, DataSetErrorWithBacktrace>

Source

pub fn add_dynamic_array_entry( &mut self, schema_set: &SchemaSet, path: impl AsRef<str>, ) -> Result<Uuid, DataSetErrorWithBacktrace>

Source

pub fn add_map_entry( &mut self, schema_set: &SchemaSet, path: impl AsRef<str>, ) -> Result<Uuid, DataSetErrorWithBacktrace>

Source

pub fn insert_dynamic_array_entry( &mut self, schema_set: &SchemaSet, path: impl AsRef<str>, index: usize, entry_uuid: Uuid, ) -> Result<(), DataSetErrorWithBacktrace>

Source

pub fn remove_dynamic_array_entry( &mut self, schema_set: &SchemaSet, path: impl AsRef<str>, element_id: Uuid, ) -> Result<bool, DataSetErrorWithBacktrace>

Source

pub fn remove_map_entry( &mut self, schema_set: &SchemaSet, path: impl AsRef<str>, element_id: Uuid, ) -> Result<bool, DataSetErrorWithBacktrace>

Source

pub fn resolve_dynamic_array_entries( &self, schema_set: &SchemaSet, path: impl AsRef<str>, ) -> Result<Box<[Uuid]>, DataSetErrorWithBacktrace>

Source

pub fn resolve_map_entries( &self, schema_set: &SchemaSet, path: impl AsRef<str>, ) -> Result<Box<[Uuid]>, DataSetErrorWithBacktrace>

Trait Implementations§

Source§

impl Clone for SingleObject

Source§

fn clone(&self) -> SingleObject

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SingleObject

Source§

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

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

impl Hash for SingleObject

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more

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> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.