Struct flute::sender::Sender

source ·
pub struct Sender { /* private fields */ }
Expand description

FLUTE Sender session Transform objects (files) to ALC/LCT packet

Implementations§

source§

impl Sender

source

pub fn new( endpoint: UDPEndpoint, tsi: u64, oti: &Oti, config: &Config ) -> Sender

Creation of a FLUTE Sender

source

pub fn subscribe(&mut self, s: Arc<dyn Subscriber>)

Add an observer

source

pub fn unsubscribe(&mut self, s: Arc<dyn Subscriber>)

Remove an observer

source

pub fn get_udp_endpoint(&self) -> &UDPEndpoint

Get UDP endpoint

source

pub fn get_tsi(&self) -> u64

Get TSI

source

pub fn add_object(&mut self, obj: Box<ObjectDesc>) -> Result<u128>

Add an object to the FDT

After calling this function, a call to publish() to publish your modifications

If a TOI as been set to the ObjectDesc, there is no need to release it

§Returns

A Result containing an u128 representing the unique identifier of the added object (TOI), if the operation was successful.

source

pub fn is_added(&self, toi: u128) -> bool

Check if the object is inside the FDT

source

pub fn remove_object(&mut self, toi: u128) -> bool

Remove an object from the FDT

After calling this function, a call to publish() to publish your modifications

Warning, if the object is being transferred, the transfer is not canceled

§Returns

trueif the object has been removed from the FDT

source

pub fn nb_objects(&self) -> usize

Number of objects signalled in the FDT

source

pub fn publish(&mut self, now: SystemTime) -> Result<()>

Publish modification to the FDT An updated version of the FDT will be generated and transferred Multiple modification can be made (ex: several call to ’add_object()`) before publishing a new FDT version

source

pub fn set_complete(&mut self)

Inform that the FDT is complete, no new object should be added after this call You must not call add_object()after After calling this function, a call to publish() to publish your modifications

source

pub fn read_close_session(&mut self, _now: SystemTime) -> Vec<u8>

Generate a close_session packet

source

pub fn allocate_toi(&mut self) -> Arc<Toi>

Allocate a TOI TOI must be either release or assigned to an object and call add_object()`

source

pub fn fdt_xml_data(&self, now: SystemTime) -> Result<Vec<u8>>

Convert current FDT to XML

source

pub fn get_objects_in_fdt(&self) -> HashMap<u128, &ObjectDesc>

Get List of objects inside the FDT

source

pub fn read(&mut self, now: SystemTime) -> Option<Vec<u8>>

Read the next ALC/LCT packet return None if there is no new packet to be transferred ALC/LCT packet should be encapsulated into a UDP/IP payload and transferred via UDP/multicast

Trait Implementations§

source§

impl Debug for Sender

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Sender

§

impl Send for Sender

§

impl Sync for Sender

§

impl Unpin for Sender

§

impl !UnwindSafe for Sender

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V