[−][src]Struct qldb::Document
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
impl Document
[src]
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,
[src]
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.
pub fn get(&self, name: &str) -> Option<&IonValue>
[src]
Gets the raw IonValue
pub fn get_optional_value<T>(&self, name: &str) -> QLDBExtractResult<Option<T>> where
T: TryFrom<IonValue> + Send + Sync + Clone,
<T as TryFrom<IonValue>>::Error: Error + Send + Sync + 'static,
[src]
T: TryFrom<IonValue> + Send + Sync + Clone,
<T as TryFrom<IonValue>>::Error: Error + Send + Sync + 'static,
Same as extract_value
but it returns None if the property is not there.
Trait Implementations
impl Clone for Document
[src]
impl Debug for Document
[src]
impl Extend<Document> for DocumentCollection
[src]
pub fn extend<T: IntoIterator<Item = Document>>(&mut self, iter: T)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl PartialEq<Document> for Document
[src]
impl StructuralPartialEq for Document
[src]
impl TryFrom<IonValue> for Document
[src]
Auto Trait Implementations
impl RefUnwindSafe for Document
[src]
impl Send for Document
[src]
impl Sync for Document
[src]
impl Unpin for Document
[src]
impl UnwindSafe for Document
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,