pub struct DocumentView { /* private fields */ }Expand description
The materialised view of a Document. It’s fields match the documents schema definition.
DocumentViews are immutable versions of a Document. They represent a document at a certain
point in time.
Implementations§
Source§impl DocumentView
impl DocumentView
Sourcepub fn new(id: &DocumentViewId, fields: &DocumentViewFields) -> Self
pub fn new(id: &DocumentViewId, fields: &DocumentViewFields) -> Self
Construct a document view.
Requires the DocumentViewId and field values to be calculated seperately and then passed in during construction.
Sourcepub fn id(&self) -> &DocumentViewId
pub fn id(&self) -> &DocumentViewId
Get the id of this document view.
Sourcepub fn get(&self, key: &str) -> Option<&DocumentViewValue>
pub fn get(&self, key: &str) -> Option<&DocumentViewValue>
Get a single value from this instance by it’s key.
Sourcepub fn iter(&self) -> BTreeMapIter<'_, String, DocumentViewValue>
pub fn iter(&self) -> BTreeMapIter<'_, String, DocumentViewValue>
Returns an iterator of existing instance fields.
Sourcepub fn fields(&self) -> &DocumentViewFields
pub fn fields(&self) -> &DocumentViewFields
Returns the fields of this document view.
Trait Implementations§
Source§impl Clone for DocumentView
impl Clone for DocumentView
Source§fn clone(&self) -> DocumentView
fn clone(&self) -> DocumentView
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocumentView
impl Debug for DocumentView
Source§impl Display for DocumentView
impl Display for DocumentView
Source§impl Human for DocumentView
impl Human for DocumentView
Source§impl PartialEq for DocumentView
impl PartialEq for DocumentView
Source§impl TryFrom<DocumentView> for SchemaFieldView
impl TryFrom<DocumentView> for SchemaFieldView
Source§type Error = SystemSchemaError
type Error = SystemSchemaError
The type returned in the event of a conversion error.
Source§impl TryFrom<DocumentView> for SchemaView
impl TryFrom<DocumentView> for SchemaView
Source§type Error = SystemSchemaError
type Error = SystemSchemaError
The type returned in the event of a conversion error.
impl StructuralPartialEq for DocumentView
Auto Trait Implementations§
impl Freeze for DocumentView
impl RefUnwindSafe for DocumentView
impl Send for DocumentView
impl Sync for DocumentView
impl Unpin for DocumentView
impl UnwindSafe for DocumentView
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more