pub struct ProcessProducer { /* private fields */ }
Expand description

Process producer which manages the construction of a servant instance

Implementations§

source§

impl ProcessProducer

source

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
source

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())
source

pub fn named_process_with_data<D>(self, data: D) -> ProcessInstance
where D: 'static + Send,

Generate an empty process instance with data

  • data: D : a data
  • D : type of the data
  • Output: a process instance with data and a future which is always pending (see the definition of terminated())
source

pub fn named_process_with_future<F>(self, future: F) -> ProcessInstance
where F: Future<Output = ()> + Send + 'static,

Generate a process instance for a given future

  • future: F : a future to be run by the process instance
  • F : type of the future
  • Output: a process instance wrapping the given future
source

pub fn named_process_with_data_future<D, F>( self, data: D, future: F ) -> ProcessInstance
where D: 'static + Send, F: Future<Output = ()> + Send + 'static,

Generate a process instance for a given future

  • data: D : a data
  • future: F : a future to be run by the process instance
  • D : type of the data
  • F : type of the future
  • Output: a process instance wrapping the given future with data
source

pub fn add_reply2<U, V, F>( &mut self, name_channel: &String, f: F ) -> Result<(), String>
where F: Fn(&'static mut ArchData<U>) -> Pin<Box<dyn Future<Output = ArchData<V>> + Send>> + Clone + Send + Sync + 'static, U: 'static + SlxData + Send, V: 'static + SlxData,

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 reply
  • U : type of the query; needs to implement SlxData
  • V : type of the reply; needs to implement SlxData
  • F : type of the processing closure; needs to implement Fn(&'static mut ArchData<U>) -> Pin<Box<dyn Future<Output = ArchData<V> > + Send>>
  • Output: nothing or an error
source

pub fn add_reply1<U, F>( &mut self, name_channel: &String, f: F ) -> Result<(), String>
where F: Fn(Pin<&'static mut ArchData<U>>) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync + 'static, U: 'static + SlxData,

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 reply
  • U : type of the query and of reply; needs to implement SlxData
  • F : type of the processing closure; needs to implement Fn(&'static mut ArchData<U>) -> Pin<Box<dyn Future<Output = ArchData<V> > + Send>>
  • Output: nothing or an error
source

pub fn add_query<U, V>( &mut self, name_channel: &String, capacity: Option<usize> ) -> Result<(ArchDispatchSender<U>, ArchDispatchReceiver<V>), String>
where U: SlxData, V: SlxData,

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 (None for unlimited)
  • U : type of the query; needs to implement SlxData
  • V : type of the reply; needs to implement SlxData
  • Output: a dispatch sender for the query and a dispatch receiver for the reply or an error
source

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 (None for unlimited)
  • U : type of the emitted data; needs to implement SlxData
  • Output: a dispatch sender for emitting or an error
source

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 (None for unlimited)
  • V : type of the read data; needs to implement SlxData
  • Output: a dispatch receiver for reading or an error
source

pub fn add_ref_read<V, F>( &mut self, name_channel: &String, reader: F ) -> Result<(), String>
where F: Fn(&'static ArchData<V>) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync + 'static, V: 'static + SlxData,

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 channel
  • reader: 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 implement SlxData
  • F : type of the reading closure; needs to implement Fn(&'static ArchData<V>) -> Pin<Box<dyn Future<Output = ()> + Send>>
  • Output: nothing or an error

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> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, O> FromSlx<T> for O
where T: SlxInto<O>,

source§

fn from_slx(slx: T) -> O

Convert slx data into original data Read more
§

impl<T> HashedTypeUuid for T

§

fn type_hash_native<REF>() -> u128
where Self: HashedTypeDef<REF>,

return native type hash
§

fn type_hash_le<REF>() -> u128
where Self: HashedTypeDef<REF>,

return little endianess type hash
§

fn type_hash_be<REF>() -> u128
where Self: HashedTypeDef<REF>,

return big endianess type hash
§

fn type_uuid<REF>() -> Uuid
where Self: HashedTypeDef<REF>,

return uuid derived from type hash
§

fn type_uuid_hyphenated<REF>() -> String
where Self: HashedTypeDef<REF>,

return uuid hyphenated string
§

fn self_type_hash_native<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

return native type hash from instance
§

fn self_type_hash_le<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

return little endianess type hash from instance
§

fn self_type_hash_be<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

return big endianess type hash from instance
§

fn self_type_uuid<REF>(&self) -> Uuid
where Self: HashedTypeDef<REF>,

return type hash-derived uuid from instance
§

fn self_type_uuid_hyphenated<REF>(&self) -> String
where Self: HashedTypeDef<REF>,

return uuid hyphenated string from instance
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, O> IntoSlx<T> for O
where T: SlxFrom<O>,

source§

fn slx(self) -> T

Convert original data into slx data Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
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.