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: Urlsupply the resource location for this object as defined in rfc2616 14.14
source: ObjectDataSourceData Source of the object
content_type: StringMedia type of the object as defined in rfc2616 14.17
content_length: u64Size of the object (uncompressed) as defined in rfc2616 14.13
transfer_length: u64Size 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: TransferConfigTransfer configuration
Implementations§
Source§impl ObjectDesc
impl ObjectDesc
Sourcepub fn set_toi(&mut self, toi: Box<Toi>)
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 boxedToiobject representing the Time of Interest to be assigned.
Sourcepub 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>>
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
Sourcepub fn create_from_stream(
stream: ObjectDataStream,
content_type: &str,
content_location: &Url,
compute_md5: bool,
config: TransferConfig,
) -> Result<Box<ObjectDesc>>
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
Sourcepub fn create_from_buffer(
content: Vec<u8>,
content_type: &str,
content_location: &Url,
compute_md5: bool,
config: TransferConfig,
) -> Result<Box<ObjectDesc>>
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§
Auto Trait Implementations§
impl !Freeze for ObjectDesc
impl RefUnwindSafe for ObjectDesc
impl Send for ObjectDesc
impl Sync for ObjectDesc
impl Unpin for ObjectDesc
impl UnsafeUnpin for ObjectDesc
impl UnwindSafe for ObjectDesc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more