pub struct CmpInOut<TMsg>where
    TMsg: MsgDataBound,{
    pub cache: Cache<TMsg>,
    /* private fields */
}Expand description
Подключение компонента к внутренней шине сообщений исполнителя
Fields§
§cache: Cache<TMsg>Ссылка на кэш TODO - проверить, скорее всего можно сделать приватным
Implementations§
Source§impl<TMsg> CmpInOut<TMsg>where
    TMsg: MsgDataBound,
 
impl<TMsg> CmpInOut<TMsg>where
    TMsg: MsgDataBound,
Sourcepub fn new(
    input: Receiver<Message<TMsg>>,
    output: Sender<Message<TMsg>>,
    cache: Cache<TMsg>,
    name: &str,
    id: Uuid,
    auth_perm: AuthPermissions,
    fn_auth: fn(Message<TMsg>, &AuthPermissions) -> Option<Message<TMsg>>,
) -> Self
 
pub fn new( input: Receiver<Message<TMsg>>, output: Sender<Message<TMsg>>, cache: Cache<TMsg>, name: &str, id: Uuid, auth_perm: AuthPermissions, fn_auth: fn(Message<TMsg>, &AuthPermissions) -> Option<Message<TMsg>>, ) -> Self
Создание подключения к внутренней шине сообщений исполнителя
Sourcepub fn clone_with_new_id(&self, name: &str, auth_perm: AuthPermissions) -> Self
 
pub fn clone_with_new_id(&self, name: &str, auth_perm: AuthPermissions) -> Self
Клонировать и присвоить новый идентификатор
Необходимо вызывать в начале исполнения компонента, чтобы у каждого компонента был уникальный id
Sourcepub async fn recv_input(&mut self) -> Result<Message<TMsg>, ComponentError>
 
pub async fn recv_input(&mut self) -> Result<Message<TMsg>, ComponentError>
Получение сообщений со входа
Sourcepub async fn recv_cache_all(&self) -> Vec<Message<TMsg>>
 
pub async fn recv_cache_all(&self) -> Vec<Message<TMsg>>
Возвращает копию сообщений из кеша
Sourcepub async fn recv_cache_msg(&self, key: &str) -> Option<Message<TMsg>>
 
pub async fn recv_cache_msg(&self, key: &str) -> Option<Message<TMsg>>
Возвращает сообщение из кеша по ключу
Sourcepub async fn send_output(
    &self,
    msg: Message<TMsg>,
) -> Result<(), ComponentError>
 
pub async fn send_output( &self, msg: Message<TMsg>, ) -> Result<(), ComponentError>
Отправка сообщений на выход
Sourcepub fn send_output_blocking(
    &self,
    msg: Message<TMsg>,
) -> Result<(), ComponentError>
 
pub fn send_output_blocking( &self, msg: Message<TMsg>, ) -> Result<(), ComponentError>
Отправка исходящих сообщений, в синхронном окружении
Sourcepub fn max_capacity(&self) -> usize
 
pub fn max_capacity(&self) -> usize
Возвращает максимальный размер очереди сообщений
Trait Implementations§
Source§impl<TMsg> Clone for CmpInOut<TMsg>where
    TMsg: MsgDataBound,
 
impl<TMsg> Clone for CmpInOut<TMsg>where
    TMsg: MsgDataBound,
Auto Trait Implementations§
impl<TMsg> Freeze for CmpInOut<TMsg>
impl<TMsg> !RefUnwindSafe for CmpInOut<TMsg>
impl<TMsg> Send for CmpInOut<TMsg>
impl<TMsg> Sync for CmpInOut<TMsg>
impl<TMsg> Unpin for CmpInOut<TMsg>
impl<TMsg> !UnwindSafe for CmpInOut<TMsg>
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