Skip to main content

ObjectDesc

Struct ObjectDesc 

Source
pub struct ObjectDesc {
    pub content_location: Url,
    pub source: ObjectDataSource,
    pub content_type: String,
    pub content_length: u64,
    pub transfer_length: u64,
    pub md5: Option<String>,
    pub config: TransferConfig,
}
Expand description

Object (file) that can be send over FLUTE

Fields§

§content_location: Url

supply the resource location for this object as defined in rfc2616 14.14

§source: ObjectDataSource

Data Source of the object

§content_type: String

Media type of the object as defined in rfc2616 14.17

§content_length: u64

Size of the object (uncompressed) as defined in rfc2616 14.13

§transfer_length: u64

Size of the object after transfer-coding (Cenc) has been applied as defined in rfc2616 4.4

§md5: Option<String>

the MD5 sum of this object. Can be used by the FLUTE receiver to validate the integrity of the reception

§config: TransferConfig

Transfer configuration

Implementations§

Source§

impl ObjectDesc

Source

pub fn set_toi(&mut self, toi: Box<Toi>)

Assigns a Transport Object Identification (TOI) to this object.

If no TOI is assigned, a new TOI will be created during the push of this object into the FLUTE session.

§Arguments
  • toi - A boxed Toi object representing the Time of Interest to be assigned.
Source

pub fn create_from_file( path: &Path, content_location: Option<&Url>, content_type: &str, cache_in_ram: bool, compute_md5: bool, config: TransferConfig, ) -> Result<Box<ObjectDesc>>

Return an ObjectDesc from a file

Source

pub fn create_from_stream( stream: ObjectDataStream, content_type: &str, content_location: &Url, compute_md5: bool, config: TransferConfig, ) -> Result<Box<ObjectDesc>>

Create an Object Description from a stream

Source

pub fn create_from_buffer( content: Vec<u8>, content_type: &str, content_location: &Url, compute_md5: bool, config: TransferConfig, ) -> Result<Box<ObjectDesc>>

Return an ObjectDesc from a buffer

Trait Implementations§

Source§

impl Debug for ObjectDesc

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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

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.