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 copy 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> 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

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,

§

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>,

§

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>,

§

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.