pub struct Document { /* private fields */ }Expand description
It contains the IonValue representing the QLDB Document.
It contains methods that will extract and try to transfor the IonValue to your type.
use qldb::{QldbExtractResult, Document};
fn test(document: Document) -> QldbExtractResult<u64> {
let points: u64 = document.get_value("points")?;
Ok(points)
}Implementations
sourceimpl Document
impl Document
sourcepub fn get_value<T>(&self, name: &str) -> QldbExtractResult<T> where
T: TryFrom<IonValue> + Send + Sync + Clone,
<T as TryFrom<IonValue>>::Error: Error + Send + Sync + 'static,
pub fn get_value<T>(&self, name: &str) -> QldbExtractResult<T> where
T: TryFrom<IonValue> + Send + Sync + Clone,
<T as TryFrom<IonValue>>::Error: Error + Send + Sync + 'static,
Extract a value from the document and tries to transform to the value of the return type. Fails if the property is not there.
Trait Implementations
sourceimpl Extend<Document> for DocumentCollection
impl Extend<Document> for DocumentCollection
sourcefn extend<T: IntoIterator<Item = Document>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Document>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬 This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬 This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
impl StructuralPartialEq for Document
Auto Trait Implementations
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more