Struct aws_smithy_http_server_python::PySocket
source · pub struct PySocket { /* private fields */ }
Expand description
Socket implementation that can be shared between multiple Python processes.
Python cannot handle true multi-threaded applications due to the GIL, often resulting in reduced performance and only one core used by the application. To work around this, Python web applications usually create a socket with SO_REUSEADDR and SO_REUSEPORT enabled that can be shared between multiple Python processes, allowing you to maximize performance and use all available computing capacity of the host.
:param address str: :param port int: :param backlog typing.Optional[int]: :rtype None:
Implementations§
Trait Implementations§
source§impl PyClassImpl for PySocket
impl PyClassImpl for PySocket
source§const DOC: &'static str = "PySocket($self, address, port, backlog=None)\n--\n\nSocket implementation that can be shared between multiple Python processes.\n\nPython cannot handle true multi-threaded applications due to the [GIL],\noften resulting in reduced performance and only one core used by the application.\nTo work around this, Python web applications usually create a socket with\nSO_REUSEADDR and SO_REUSEPORT enabled that can be shared between multiple\nPython processes, allowing you to maximize performance and use all available\ncomputing capacity of the host.\n\n[GIL]: https://wiki.python.org/moin/GlobalInterpreterLock\n\n:param address str:\n:param port int:\n:param backlog typing.Optional\\[int\\]:\n:rtype None:\u{0}"
const DOC: &'static str = "PySocket($self, address, port, backlog=None)\n--\n\nSocket implementation that can be shared between multiple Python processes.\n\nPython cannot handle true multi-threaded applications due to the [GIL],\noften resulting in reduced performance and only one core used by the application.\nTo work around this, Python web applications usually create a socket with\nSO_REUSEADDR and SO_REUSEPORT enabled that can be shared between multiple\nPython processes, allowing you to maximize performance and use all available\ncomputing capacity of the host.\n\n[GIL]: https://wiki.python.org/moin/GlobalInterpreterLock\n\n:param address str:\n:param port int:\n:param backlog typing.Optional\\[int\\]:\n:rtype None:\u{0}"
Class doc string
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 = ThreadCheckerStub<PySocket>
type ThreadChecker = ThreadCheckerStub<PySocket>
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 PyMethods<PySocket> for PyClassImplCollector<PySocket>
impl PyMethods<PySocket> for PyClassImplCollector<PySocket>
fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for PySocket
impl PyTypeInfo for PySocket
§type AsRefTarget = PyCell<PySocket>
type AsRefTarget = PyCell<PySocket>
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 PySocket
impl RefUnwindSafe for PySocket
impl Send for PySocket
impl Sync for PySocket
impl Unpin for PySocket
impl UnwindSafe for PySocket
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.