Struct Document

Source
pub struct Document<M> {
    pub statements: Vec<Meta<Statement<M>, M>>,
}
Expand description

A Turtle document.

Fields§

§statements: Vec<Meta<Statement<M>, M>>

Implementations§

Source§

impl<M> Document<M>

Source

pub fn new() -> Document<M>

Source

pub fn insert(&mut self, statement: Meta<Statement<M>, M>)

Source§

impl<M: Clone> Document<M>

Source

pub fn build_triples( &self, base_iri: Option<IriBuf>, generator: impl Generator<()>, ) -> Result<Vec<MetaTriple<M, ()>>, MetaError<M>>

Source

pub fn build_triples_with<V: RdfVocabulary + IriVocabularyMut + BlankIdVocabularyMut + LanguageTagVocabularyMut>( &self, base_iri: Option<V::Iri>, vocabulary: &mut V, generator: impl Generator<V>, ) -> Result<Vec<MetaTriple<M, V>>, MetaError<M>>
where V::Iri: Clone, V::BlankId: Clone,

Trait Implementations§

Source§

impl<M: Clone, V: RdfVocabulary + IriVocabularyMut + BlankIdVocabularyMut + LanguageTagVocabularyMut, G: Generator<V>> Build<M, V, G> for Document<M>
where V::Iri: Clone, V::BlankId: Clone,

Source§

fn build( &self, context: &mut Context<'_, '_, M, V, G>, triples: &mut Vec<MetaTriple<M, V>>, ) -> Result<(), MetaError<M>>

Source§

impl<M: Clone> Clone for Document<M>

Source§

fn clone(&self) -> Document<M>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<M: Debug> Debug for Document<M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<M> Default for Document<M>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<M> Parse<M> for Document<M>

Source§

fn parse_from<L, F>( parser: &mut Parser<L, F>, Meta: Meta<Token, Span>, ) -> Result<Meta<Self, M>, MetaError<L::Error, M>>
where L: Tokens, F: FnMut(Span) -> M,

Source§

fn parse_empty<L>(meta: M) -> Result<Meta<Self, M>, MetaError<L::Error, M>>
where L: Tokens,

Source§

fn parse_with<L, F>( parser: &mut Parser<L, F>, ) -> Result<Meta<Self, M>, MetaError<L::Error, M>>
where L: Tokens, F: FnMut(Span) -> M,

Source§

fn parse<C, F, E>( chars: C, metadata_builder: F, ) -> Result<Meta<Self, M>, MetaError<Error<E>, M>>
where C: Iterator<Item = Result<DecodedChar, E>>, F: FnMut(Span) -> M,

Source§

fn parse_infallible<C, F>( chars: C, metadata_builder: F, ) -> Result<Meta<Self, M>, MetaError<Error, M>>
where C: Iterator<Item = DecodedChar>, F: FnMut(Span) -> M,

Source§

fn parse_utf8<C, F, E>( chars: C, metadata_builder: F, ) -> Result<Meta<Self, M>, MetaError<Error<E>, M>>
where C: Iterator<Item = Result<char, E>>, F: FnMut(Span) -> M,

Source§

fn parse_utf8_infallible<C, F>( chars: C, metadata_builder: F, ) -> Result<Meta<Self, M>, MetaError<Error, M>>
where C: Iterator<Item = char>, F: FnMut(Span) -> M,

Source§

fn parse_utf16<C, F, E>( chars: C, metadata_builder: F, ) -> Result<Meta<Self, M>, MetaError<Error<E>, M>>
where C: Iterator<Item = Result<char, E>>, F: FnMut(Span) -> M,

Source§

fn parse_utf16_infallible<C, F>( chars: C, metadata_builder: F, ) -> Result<Meta<Self, M>, MetaError<Error, M>>
where C: Iterator<Item = char>, F: FnMut(Span) -> M,

Source§

fn parse_str<F>( string: &str, metadata_builder: F, ) -> Result<Meta<Self, M>, MetaError<Error, M>>
where F: FnMut(Span) -> M,

Auto Trait Implementations§

§

impl<M> Freeze for Document<M>

§

impl<M> RefUnwindSafe for Document<M>
where M: RefUnwindSafe,

§

impl<M> Send for Document<M>
where M: Send,

§

impl<M> Sync for Document<M>
where M: Sync,

§

impl<M> Unpin for Document<M>
where M: Unpin,

§

impl<M> UnwindSafe for Document<M>
where M: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> At for T

Source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BorrowStripped for T

Source§

fn stripped(&self) -> &Stripped<T>

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.