pub struct PyResponse { /* private fields */ }
Expand description
Python-compatible Response object.
For performance reasons, there is not support yet to pass the body to the Python middleware, as it requires to consume and clone the body, which is a very expensive operation.
Trait Implementations
sourceimpl Clone for PyResponse
impl Clone for PyResponse
sourcefn clone(&self) -> PyResponse
fn clone(&self) -> PyResponse
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for PyResponse
impl Debug for PyResponse
sourceimpl From<PyResponse> for Response<BoxBody>
impl From<PyResponse> for Response<BoxBody>
Allow to convert between a PyResponse and a Response.
sourcefn from(pyresponse: PyResponse) -> Self
fn from(pyresponse: PyResponse) -> Self
Converts to this type from the input type.
sourceimpl IntoPy<Py<PyAny>> for PyResponse
impl IntoPy<Py<PyAny>> for PyResponse
sourceimpl PyClass for PyResponse
impl PyClass for PyResponse
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 moresourceimpl PyClassImpl for PyResponse
impl PyClassImpl for PyResponse
sourceconst IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[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 Layout = PyCell<PyResponse>
type Layout = PyCell<PyResponse>
Layout
type ThreadChecker = ThreadCheckerStub<PyResponse>
type ThreadChecker = ThreadCheckerStub<PyResponse>
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<PyResponse> for PyClassImplCollector<PyResponse>
impl PyMethods<PyResponse> for PyClassImplCollector<PyResponse>
fn py_methods(self) -> &'static PyClassItems
sourceimpl PyTypeInfo for PyResponse
impl PyTypeInfo for PyResponse
type AsRefTarget = PyCell<PyResponse>
type AsRefTarget = PyCell<PyResponse>
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 PyResponse
impl Send for PyResponse
impl Sync for PyResponse
impl Unpin for PyResponse
impl UnwindSafe for PyResponse
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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 Twhere
T: PyClass + Clone,
impl<'a, T> FromPyObject<'a> for Twhere
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 Twhere
T: PyTypeInfo,
impl<T> PyTypeObject for Twhere
T: PyTypeInfo,
sourcefn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.