pub struct Sender { /* private fields */ }Expand description
FLUTE Sender session
Transform objects (files) to ALC/LCT packet
Implementations§
source§impl Sender
impl Sender
sourcepub fn new(
endpoint: UDPEndpoint,
tsi: u64,
oti: &Oti,
config: &Config
) -> Sender
pub fn new( endpoint: UDPEndpoint, tsi: u64, oti: &Oti, config: &Config ) -> Sender
Creation of a FLUTE Sender
sourcepub fn subscribe(&mut self, s: Arc<dyn Subscriber>)
pub fn subscribe(&mut self, s: Arc<dyn Subscriber>)
Add an observer
sourcepub fn unsubscribe(&mut self, s: Arc<dyn Subscriber>)
pub fn unsubscribe(&mut self, s: Arc<dyn Subscriber>)
Remove an observer
sourcepub fn get_udp_endpoint(&self) -> &UDPEndpoint
pub fn get_udp_endpoint(&self) -> &UDPEndpoint
Get UDP endpoint
sourcepub fn add_object(&mut self, obj: Box<ObjectDesc>) -> Result<u128>
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.
sourcepub fn remove_object(&mut self, toi: u128) -> bool
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
sourcepub fn nb_objects(&self) -> usize
pub fn nb_objects(&self) -> usize
Number of objects signalled in the FDT
sourcepub fn publish(&mut self, now: SystemTime) -> Result<()>
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
sourcepub fn set_complete(&mut self)
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
sourcepub fn read_close_session(&mut self, _now: SystemTime) -> Vec<u8>
pub fn read_close_session(&mut self, _now: SystemTime) -> Vec<u8>
Generate a close_session packet
sourcepub fn allocate_toi(&mut self) -> Arc<Toi>
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()`
sourcepub fn fdt_xml_data(&self, now: SystemTime) -> Result<Vec<u8>>
pub fn fdt_xml_data(&self, now: SystemTime) -> Result<Vec<u8>>
Convert current FDT to XML
sourcepub fn get_objects_in_fdt(&self) -> HashMap<u128, &ObjectDesc>
pub fn get_objects_in_fdt(&self) -> HashMap<u128, &ObjectDesc>
Get List of objects inside the FDT