Struct pretty_rdf::PChunk

source ·
pub struct PChunk<A: AsRef<str>> { /* private fields */ }
Expand description

A set of triple like objects that represents a coherent chunk

Current invariants:

  • each subject should appear only once (i.e. all subjects are grouped in PMultiTriple, or AsRefSeq)
  • if a subject appears it represents all appearances of the node as a subject in the document of which this is a chunk
  • if BNodes appear as subjects, they appear after any apperance as an object (TODO: Not implemented yet!)

Implementations§

source§

impl<A> PChunk<A>
where A: AsRef<str> + Clone + Debug + Eq + Hash + PartialEq,

source

pub fn normalize(v: Vec<PTriple<A>>) -> Self

Given a set of triples normalize these to a chunk wth appropriate prettification applied

source

pub fn empty() -> Self

source

pub fn sort(&mut self)

source

pub fn accept_or_push_back(&mut self, t: PTriple<A>)

source

pub fn push_back(&mut self, et: PExpandedTriple<A>)

source

pub fn pop_front(&mut self) -> Option<PExpandedTriple<A>>

Trait Implementations§

source§

impl<A: Debug + AsRef<str>> Debug for PChunk<A>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<A> Freeze for PChunk<A>

§

impl<A> !RefUnwindSafe for PChunk<A>

§

impl<A> Send for PChunk<A>
where A: Send,

§

impl<A> !Sync for PChunk<A>

§

impl<A> Unpin for PChunk<A>
where A: Unpin,

§

impl<A> UnwindSafe for PChunk<A>
where A: 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> 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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.