pub struct SocketClient { /* private fields */ }
Implementations§
Source§impl SocketClient
impl SocketClient
pub async fn connect( config: SocketConfig, post_connection: Option<PyObject>, post_reconnection: Option<PyObject>, post_disconnection: Option<PyObject>, ) -> Result<Self, Error>
Sourcepub async fn disconnect(&self)
pub async fn disconnect(&self)
Set disconnect mode to true.
Controller task will periodically check the disconnect mode and shutdown the client if it is not alive.
pub async fn send_bytes(&self, data: &[u8]) -> Result<(), Error>
pub fn is_disconnected(&self) -> bool
Trait Implementations§
Source§impl IntoPy<Py<PyAny>> for SocketClient
impl IntoPy<Py<PyAny>> for SocketClient
Source§impl PyClass for SocketClient
impl PyClass for SocketClient
Source§impl PyClassImpl for SocketClient
impl PyClassImpl for SocketClient
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)]
Source§type ThreadChecker = SendablePyClass<SocketClient>
type ThreadChecker = SendablePyClass<SocketClient>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§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 SocketClient
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a SocketClient
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut SocketClient
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut SocketClient
Source§impl PyMethods<SocketClient> for PyClassImplCollector<SocketClient>
impl PyMethods<SocketClient> for PyClassImplCollector<SocketClient>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for SocketClient
impl PyTypeInfo for SocketClient
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_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type.impl DerefToPyAny for SocketClient
Auto Trait Implementations§
impl Freeze for SocketClient
impl !RefUnwindSafe for SocketClient
impl Send for SocketClient
impl Sync for SocketClient
impl Unpin for SocketClient
impl !UnwindSafe for SocketClient
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