Struct silx_core::utils::ProcessProducer
source · pub struct ProcessProducer { /* private fields */ }Expand description
Process producer which manages the construction of a servant instance
Implementations§
source§impl ProcessProducer
impl ProcessProducer
sourcepub fn new(send_to_master: &SendToMaster) -> Self
pub fn new(send_to_master: &SendToMaster) -> Self
Constructor of a process producer
send_to_master: &SendToMaster: a channel sender from the servant to the master of the cluster- Output: the process producer
sourcepub fn named_process(self) -> ProcessInstance
pub fn named_process(self) -> ProcessInstance
Generate an empty process instance
- Output: a process instance with a future which is always pending (see the definition of
terminated())
sourcepub fn named_process_with_data<D>(self, data: D) -> ProcessInstancewhere
D: 'static + Send,
pub fn named_process_with_data<D>(self, data: D) -> ProcessInstancewhere
D: 'static + Send,
Generate an empty process instance with data
data: D: a dataD: type of the data- Output: a process instance with data and a future which is always pending (see the definition of
terminated())
sourcepub fn named_process_with_future<F>(self, future: F) -> ProcessInstance
pub fn named_process_with_future<F>(self, future: F) -> ProcessInstance
Generate a process instance for a given future
future: F: a future to be run by the process instanceF: type of the future- Output: a process instance wrapping the given future
sourcepub fn named_process_with_data_future<D, F>(
self,
data: D,
future: F
) -> ProcessInstance
pub fn named_process_with_data_future<D, F>( self, data: D, future: F ) -> ProcessInstance
Generate a process instance for a given future
data: D: a datafuture: F: a future to be run by the process instanceD: type of the dataF: type of the future- Output: a process instance wrapping the given future with data
sourcepub fn add_reply2<U, V, F>(
&mut self,
name_channel: &String,
f: F
) -> Result<(), String>
pub fn add_reply2<U, V, F>( &mut self, name_channel: &String, f: F ) -> Result<(), String>
Add a reply-to-query component of type 2 to the process producer
name_channel: &String: name of the query channel- channels connected to the servant necessarily have different names
f: F: closure processing the replyU: type of the query; needs to implementSlxDataV: type of the reply; needs to implementSlxDataF: type of the processing closure; needs to implementFn(&'static mut ArchData<U>) -> Pin<Box<dyn Future<Output = ArchData<V> > + Send>>- Output: nothing or an error
sourcepub fn add_reply1<U, F>(
&mut self,
name_channel: &String,
f: F
) -> Result<(), String>
pub fn add_reply1<U, F>( &mut self, name_channel: &String, f: F ) -> Result<(), String>
Add a reply-to-query component of type 1 to the process producer
name_channel: &String: name of the query channel- channels connected to the servant necessarily have different names
f: F: closure processing the replyU: type of the query and of reply; needs to implementSlxDataF: type of the processing closure; needs to implementFn(&'static mut ArchData<U>) -> Pin<Box<dyn Future<Output = ArchData<V> > + Send>>- Output: nothing or an error
sourcepub fn add_query<U, V>(
&mut self,
name_channel: &String,
capacity: Option<usize>
) -> Result<(ArchDispatchSender<U>, ArchDispatchReceiver<V>), String>
pub fn add_query<U, V>( &mut self, name_channel: &String, capacity: Option<usize> ) -> Result<(ArchDispatchSender<U>, ArchDispatchReceiver<V>), String>
Add a query-and-get-reply component to the process producer
name_channel: &String: name of the query channel- channels connected to the servant necessarily have different names
capacity: Option<usize>: capacity of the channel (Nonefor unlimited)U: type of the query; needs to implementSlxDataV: type of the reply; needs to implementSlxData- Output: a dispatch sender for the query and a dispatch receiver for the reply or an error
sourcepub fn add_emit<U>(
&mut self,
name_channel: &String,
capacity: Option<usize>
) -> Result<ArchDispatchSender<U>, String>where
U: SlxData,
pub fn add_emit<U>(
&mut self,
name_channel: &String,
capacity: Option<usize>
) -> Result<ArchDispatchSender<U>, String>where
U: SlxData,
Add an emit component to the process producer
name_channel: &String: name of the emitting channel- channels connected to the servant necessarily have different names
capacity: Option<usize>: capacity of the channel (Nonefor unlimited)U: type of the emitted data; needs to implementSlxData- Output: a dispatch sender for emitting or an error
sourcepub fn add_read<V>(
&mut self,
name_channel: &String,
capacity: Option<usize>
) -> Result<ArchDispatchReceiver<V>, String>where
V: SlxData,
pub fn add_read<V>(
&mut self,
name_channel: &String,
capacity: Option<usize>
) -> Result<ArchDispatchReceiver<V>, String>where
V: SlxData,
Add a read component to the process producer
name_channel: &String: name of the reading channel- channels connected to the servant necessarily have different names
capacity: Option<usize>: capacity of the channel (Nonefor unlimited)V: type of the read data; needs to implementSlxData- Output: a dispatch receiver for reading or an error
sourcepub fn add_ref_read<V, F>(
&mut self,
name_channel: &String,
reader: F
) -> Result<(), String>
pub fn add_ref_read<V, F>( &mut self, name_channel: &String, reader: F ) -> Result<(), String>
Add a read-by-reference component to the process producer; the data referenceis then processed by a closure
name_channel: &String: name of the read-by-reference channelreader: F: a reader for processing the data reference- channels connected to the servant necessarily have different names
V: type of the read data; needs to implementSlxDataF: type of the reading closure; needs to implementFn(&'static ArchData<V>) -> Pin<Box<dyn Future<Output = ()> + Send>>- Output: nothing or an error
Auto Trait Implementations§
impl !RefUnwindSafe for ProcessProducer
impl Send for ProcessProducer
impl Sync for ProcessProducer
impl !Unpin for ProcessProducer
impl !UnwindSafe for ProcessProducer
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§impl<T> HashedTypeUuid for T
impl<T> HashedTypeUuid for T
§fn type_hash_native<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_native<REF>() -> u128where
Self: HashedTypeDef<REF>,
return native type hash
§fn type_hash_le<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_le<REF>() -> u128where
Self: HashedTypeDef<REF>,
return little endianess type hash
§fn type_hash_be<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_be<REF>() -> u128where
Self: HashedTypeDef<REF>,
return big endianess type hash
§fn type_uuid_hyphenated<REF>() -> Stringwhere
Self: HashedTypeDef<REF>,
fn type_uuid_hyphenated<REF>() -> Stringwhere
Self: HashedTypeDef<REF>,
return uuid hyphenated string
§fn self_type_hash_native<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_native<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
return native type hash from instance
§fn self_type_hash_le<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_le<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
return little endianess type hash from instance
§fn self_type_hash_be<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_be<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
return big endianess type hash from instance
§fn self_type_uuid<REF>(&self) -> Uuidwhere
Self: HashedTypeDef<REF>,
fn self_type_uuid<REF>(&self) -> Uuidwhere
Self: HashedTypeDef<REF>,
return type hash-derived uuid from instance
§fn self_type_uuid_hyphenated<REF>(&self) -> Stringwhere
Self: HashedTypeDef<REF>,
fn self_type_uuid_hyphenated<REF>(&self) -> Stringwhere
Self: HashedTypeDef<REF>,
return uuid hyphenated string from instance