Enum vtkio::model::Piece[][src]

pub enum Piece<P> {
    Source(StringOption<Extent>),
    Loaded(Box<DataSet>),
    Inline(Box<P>),
}

A piece of a data set.

This can be stored as a reference to another VTK file, as pointer to memory with the corresponding piece data set, or as inline piece data as described in serial XML formats or legacy formats.

Variants

Source(StringOption<Extent>)

A reference to a piece as a file path.

This variant is used with “Parallel” XML formats, which distribute their data among a collection of other files storing pieces of the data.

Loaded(Box<DataSet>)

Data set corresponding to piece data loaded from a file.

This variant is when data referenced in “Parallel” XML formats, gets loaded.

Inline(Box<P>)

Piece data stored inline with the rest of the host file.

This corresponds to Piece elements stored in serial XML formats.

Implementations

impl<P: PieceData> Piece<P>[src]

pub fn load_piece_in_place_recursive(
    &mut self,
    source_path: Option<&Path>
) -> Result<(), Error>
[src]

Converts self into a loaded piece if the current piece is only a Source.

This function recursively loads any referenced pieces down the hierarchy.

If this pieces is Loaded or Inline, this function does nothing.

The given source_path is the path to the file containing this piece (if any).

pub fn load_piece_data(&self, source_path: Option<&Path>) -> Result<P, Error> where
    P: Clone
[src]

Borrows self and returns a loaded (or cloned) piece data.

If the piece is not yet loaded, this function will load it and return the resulting data, otherwise the data is cloned.

pub fn into_loaded_piece_data(
    self,
    source_path: Option<&Path>
) -> Result<P, Error>
[src]

Consumes self and returns loaded piece data.

If the piece is not yet loaded, this function will load it and return the resulting data.

Trait Implementations

impl<P: Clone> Clone for Piece<P>[src]

impl<P: Debug> Debug for Piece<P>[src]

impl<P: PartialEq> PartialEq<Piece<P>> for Piece<P>[src]

impl<P> StructuralPartialEq for Piece<P>[src]

Auto Trait Implementations

impl<P> RefUnwindSafe for Piece<P> where
    P: RefUnwindSafe

impl<P> Send for Piece<P> where
    P: Send

impl<P> Sync for Piece<P> where
    P: Sync

impl<P> Unpin for Piece<P>

impl<P> UnwindSafe for Piece<P> where
    P: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.