Struct aws_smithy_http_server_python::PyApp
source · [−]pub struct PyApp {
pub handlers: PyHandlers,
pub context: Option<Arc<PyObject>>,
pub locals: TaskLocals,
}
Expand description
Python application definition, holding the handlers map, the optional Python context object and the asyncio task locals with the running event loop.
Fields
handlers: PyHandlers
context: Option<Arc<PyObject>>
locals: TaskLocals
Implementations
sourceimpl PyApp
impl PyApp
sourcepub fn register_operation(
&mut self,
py: Python<'_>,
name: &str,
func: PyObject
) -> PyResult<()>
pub fn register_operation(
&mut self,
py: Python<'_>,
name: &str,
func: PyObject
) -> PyResult<()>
Register a new operation in the handlers map.
The operation registered in the map are used inside the code-generated router()
method
and passed to the aws_smithy_http_server::Router as part of the operation handlers call.
Trait Implementations
sourceimpl PyClass for PyApp
impl PyClass for PyApp
type Dict = PyClassDummySlot
type Dict = PyClassDummySlot
Specify this class has #[pyclass(dict)]
or not.
type WeakRef = PyClassDummySlot
type WeakRef = PyClassDummySlot
Specify this class has #[pyclass(weakref)]
or not.
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
. Read more
sourceimpl PyClassImpl for PyApp
impl PyClassImpl for PyApp
sourceconst DOC: &'static str = "PyApp()\n--\n\nPython application definition, holding the handlers map, the optional Python context object\nand the asyncio task locals with the running event loop.\u{0}"
const DOC: &'static str = "PyApp()\n--\n\nPython application definition, holding the handlers map, the optional Python context object\nand the asyncio task locals with the running event loop.\u{0}"
Class doc string
sourceconst IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
#[pyclass(subclass)]
sourceconst IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
sourceconst IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
type ThreadChecker = ThreadCheckerStub<PyApp>
type ThreadChecker = ThreadCheckerStub<PyApp>
This handles following two situations: Read more
fn for_all_items(visitor: &mut dyn FnMut(&PyClassItems))
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
sourceimpl PyMethods<PyApp> for PyClassImplCollector<PyApp>
impl PyMethods<PyApp> for PyClassImplCollector<PyApp>
fn py_methods(self) -> &'static PyClassItems
sourceimpl PyTypeInfo for PyApp
impl PyTypeInfo for PyApp
type AsRefTarget = PyCell<PyApp>
type AsRefTarget = PyCell<PyApp>
Utility type to make Py::as_ref work.
sourcefn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
PyTypeObject instance for this type.
sourcefn 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.
sourcefn 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 !RefUnwindSafe for PyApp
impl Send for PyApp
impl Sync for PyApp
impl Unpin for PyApp
impl !UnwindSafe for PyApp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> FromPyObject<'a> for T where
T: PyClass + Clone,
impl<'a, T> FromPyObject<'a> for T where
T: PyClass + Clone,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> PyTypeObject for T where
T: PyTypeInfo,
impl<T> PyTypeObject for T where
T: PyTypeInfo,
sourcefn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more