pub struct ResponseData { /* private fields */ }Implementations§
Source§impl ResponseData
impl ResponseData
Sourcepub fn new(
owner: BytesMut,
dependent_builder: impl for<'_q> FnOnce(&'_q BytesMut) -> Response<'_q>,
) -> Self
pub fn new( owner: BytesMut, dependent_builder: impl for<'_q> FnOnce(&'_q BytesMut) -> Response<'_q>, ) -> Self
Constructs a new self-referential struct.
The provided owner will be moved into a heap allocated box. Followed by construction
of the dependent value, by calling dependent_builder with a shared reference to the
owner that remains valid for the lifetime of the constructed struct.
Sourcepub fn try_new<Err>(
owner: BytesMut,
dependent_builder: impl for<'_q> FnOnce(&'_q BytesMut) -> Result<Response<'_q>, Err>,
) -> Result<Self, Err>
pub fn try_new<Err>( owner: BytesMut, dependent_builder: impl for<'_q> FnOnce(&'_q BytesMut) -> Result<Response<'_q>, Err>, ) -> Result<Self, Err>
Constructs a new self-referential struct or returns an error.
Consumes owner on error.
Sourcepub fn try_new_or_recover<Err>(
owner: BytesMut,
dependent_builder: impl for<'_q> FnOnce(&'_q BytesMut) -> Result<Response<'_q>, Err>,
) -> Result<Self, (BytesMut, Err)>
pub fn try_new_or_recover<Err>( owner: BytesMut, dependent_builder: impl for<'_q> FnOnce(&'_q BytesMut) -> Result<Response<'_q>, Err>, ) -> Result<Self, (BytesMut, Err)>
Constructs a new self-referential struct or returns an error.
Returns owner and error as tuple on error.
Sourcepub fn borrow_owner<'_q>(&'_q self) -> &'_q BytesMut
pub fn borrow_owner<'_q>(&'_q self) -> &'_q BytesMut
Borrows owner.
Sourcepub fn with_dependent<'outer_fn, Ret>(
&'outer_fn self,
func: impl for<'_q> FnOnce(&'_q BytesMut, &'outer_fn Response<'_q>) -> Ret,
) -> Ret
pub fn with_dependent<'outer_fn, Ret>( &'outer_fn self, func: impl for<'_q> FnOnce(&'_q BytesMut, &'outer_fn Response<'_q>) -> Ret, ) -> Ret
Calls given closure func with a shared reference to dependent.
Sourcepub fn with_dependent_mut<'outer_fn, Ret>(
&'outer_fn mut self,
func: impl for<'_q> FnOnce(&'_q BytesMut, &'outer_fn mut Response<'_q>) -> Ret,
) -> Ret
pub fn with_dependent_mut<'outer_fn, Ret>( &'outer_fn mut self, func: impl for<'_q> FnOnce(&'_q BytesMut, &'outer_fn mut Response<'_q>) -> Ret, ) -> Ret
Calls given closure func with an unique reference to dependent.
Sourcepub fn borrow_dependent<'_q>(&'_q self) -> &'_q Response<'_q>
pub fn borrow_dependent<'_q>(&'_q self) -> &'_q Response<'_q>
Borrows dependent.
Sourcepub fn into_owner(self) -> BytesMut
pub fn into_owner(self) -> BytesMut
Consumes self and returns the the owner.
Trait Implementations§
Source§impl Debug for ResponseData
impl Debug for ResponseData
Source§impl Drop for ResponseData
impl Drop for ResponseData
Source§impl PartialEq for ResponseData
impl PartialEq for ResponseData
impl Eq for ResponseData
Auto Trait Implementations§
impl Freeze for ResponseData
impl RefUnwindSafe for ResponseData
impl Send for ResponseData
impl Sync for ResponseData
impl Unpin for ResponseData
impl UnsafeUnpin for ResponseData
impl UnwindSafe for ResponseData
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