pub struct CmpInOut<TMsg> {
pub cache: Cache<TMsg>,
/* private fields */
}
Fields§
§cache: Cache<TMsg>
Implementations§
Source§impl<TMsg> CmpInOut<TMsg>where
TMsg: MsgDataBound,
impl<TMsg> CmpInOut<TMsg>where
TMsg: MsgDataBound,
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
pub fn clone_with_new_id(&self, name: &str, auth_perm: AuthPermissions) -> Self
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>
Отправка сообщений на выход
Trait Implementations§
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