pub struct Document { /* private fields */ }Expand description
An index document: an ordered list of fields.
Order follows the on-wire layout. Documents average ~10 fields, so the
linear-scan find helper is fine.
Implementations§
Trait Implementations§
Source§impl TryFrom<&Document> for Record
impl TryFrom<&Document> for Record
Source§fn try_from(doc: &Document) -> Result<Self, Self::Error>
fn try_from(doc: &Document) -> Result<Self, Self::Error>
Classify a document into a Record.
Rules, checked in priority order:
DESCRIPTORfield →DescriptorallGroupsfield →AllGroupsrootGroupsfield →RootGroupsufield →ArtifactAdd(parse_uinfo(u))delfield →ArtifactRemove(parse_uinfo(del))- otherwise →
Unknown
§Errors
Returns ParseError::MalformedUinfo when an add or remove record
contains a UINFO string that cannot be parsed. Structural documents
(descriptor, group lists) never fail.
Source§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
impl Eq for Document
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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