Struct querent_synapse::comm::channel::ChannelHandler
source · pub struct ChannelHandler {
pub token_receiver: Option<Receiver<IngestedTokens>>,
pub token_sender: Option<Sender<IngestedTokens>>,
pub py_message_receiver: Option<Receiver<(MessageType, MessageState)>>,
pub message_sender: Option<Sender<(MessageType, MessageState)>>,
}
Fields§
§token_receiver: Option<Receiver<IngestedTokens>>
§token_sender: Option<Sender<IngestedTokens>>
§py_message_receiver: Option<Receiver<(MessageType, MessageState)>>
§message_sender: Option<Sender<(MessageType, MessageState)>>
Implementations§
source§impl ChannelHandler
impl ChannelHandler
pub fn new( token_sender: Option<Sender<IngestedTokens>>, token_receiver: Option<Receiver<IngestedTokens>>, py_message_receiver: Option<Receiver<(MessageType, MessageState)>>, message_sender: Option<Sender<(MessageType, MessageState)>> ) -> Self
Trait Implementations§
source§impl ChannelInterface for ChannelHandler
impl ChannelInterface for ChannelHandler
source§fn receive_tokens_in_python(&mut self) -> Option<IngestedTokens>
fn receive_tokens_in_python(&mut self) -> Option<IngestedTokens>
Receive tokens in python from rust
source§fn send_tokens_in_rust(&mut self, tokens: IngestedTokens)
fn send_tokens_in_rust(&mut self, tokens: IngestedTokens)
Send tokens in rust from python
source§fn receive_in_python(&mut self) -> Option<MessageState>
fn receive_in_python(&mut self) -> Option<MessageState>
Receive a message in python from rust
source§fn send_in_rust(
&mut self,
message_type: MessageType,
message_data: MessageState
)
fn send_in_rust( &mut self, message_type: MessageType, message_data: MessageState )
Send a message in rust from python
source§impl Clone for ChannelHandler
impl Clone for ChannelHandler
source§fn clone(&self) -> ChannelHandler
fn clone(&self) -> ChannelHandler
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ChannelHandler
impl Debug for ChannelHandler
source§impl IntoPy<Py<PyAny>> for ChannelHandler
impl IntoPy<Py<PyAny>> for ChannelHandler
source§impl PyClassImpl for ChannelHandler
impl PyClassImpl for ChannelHandler
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type ThreadChecker = SendablePyClass<ChannelHandler>
type ThreadChecker = SendablePyClass<ChannelHandler>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a ChannelHandler
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a ChannelHandler
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut ChannelHandler
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut ChannelHandler
source§impl PyTypeInfo for ChannelHandler
impl PyTypeInfo for ChannelHandler
§type AsRefTarget = PyCell<ChannelHandler>
type AsRefTarget = PyCell<ChannelHandler>
Utility type to make Py::as_ref work.
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type.Auto Trait Implementations§
impl Freeze for ChannelHandler
impl RefUnwindSafe for ChannelHandler
impl Send for ChannelHandler
impl Sync for ChannelHandler
impl Unpin for ChannelHandler
impl UnwindSafe for ChannelHandler
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