Struct rain_task::DataInstance[][src]

pub struct DataInstance {
    pub spec: ObjectSpec,
    pub info: ObjectInfo,
    // some fields omitted
}

One instance of input DataObject.

Fields

Methods

impl DataInstance
[src]

Get all the input bytes. In case the input is a file, it is mmap-ed the first time this is called.

Note that every invocation locks the input mutex.

Panics on any I/O error. Returns an error if the input is a directory.

Get the path for the input file. If the input was memory backed, this will write the file to the filesystem the first time this is called. Note that even when written to disk, the data is also still kept in memory.

Note that every invocation locks the input mutex.

A shorthand to check that the input is a directory.

Returns Err(TaskError) if not a directory.

A shorthand to check that the input is a file or data blob.

Returns Err(TaskError) if not a blob.

Panics on any I/O error.

Returns an error if the input is a directory or non-text content-type, or if the input is not valud utf-8. Any other encoding needs to be decoded manually.

Note: checks for valid utf-8 on every call.

Check the input content-type.

Return Ok if the actual type is a subtype or supertype of the given type.

Get the content-type of the object.

Returns "" for directories.

Trait Implementations

impl Debug for DataInstance
[src]

Formats the value using the given formatter. Read more

impl Display for DataInstance
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations