pub struct StoredDocument {
pub path: Arc<ResourcePath>,
pub create_time: Timestamp,
pub update_time: Timestamp,
/* private fields */
}Expand description
A stored document version.
Fields are kept protobuf-encoded: a document then costs about its wire size instead of the
decoded tree (a two-field document is ~30 bytes encoded, over 600 decoded, because every
map node reserves room for eleven entries). Readers decode with StoredDocument::fields.
Fields§
§path: Arc<ResourcePath>Shared by every version of the same document.
create_time: Timestamp§update_time: TimestampImplementations§
Source§impl StoredDocument
impl StoredDocument
pub fn new( path: Arc<ResourcePath>, fields: Fields, create_time: Timestamp, update_time: Timestamp, ) -> Self
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Size of the stored field encoding, in bytes.
Sourcepub fn has_fields(&self, fields: &Fields) -> bool
pub fn has_fields(&self, fields: &Fields) -> bool
Whether the document holds exactly fields, bit for bit: unlike == on the decoded
fields, a NaN equals itself and -0.0 differs from 0.0, as for the official emulator,
to which writing either over itself changes nothing (tools/oracle/negative_zero.py).
The order of the fields does not matter.
Trait Implementations§
Source§impl Clone for StoredDocument
impl Clone for StoredDocument
Source§impl Debug for StoredDocument
impl Debug for StoredDocument
Source§impl PartialEq for StoredDocument
impl PartialEq for StoredDocument
impl StructuralPartialEq for StoredDocument
Auto Trait Implementations§
impl Forget for StoredDocument
impl Freeze for StoredDocument
impl RefUnwindSafe for StoredDocument
impl Send for StoredDocument
impl Sync for StoredDocument
impl Unpin for StoredDocument
impl UnsafeUnpin for StoredDocument
impl UnwindSafe for StoredDocument
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request