Struct Reborrow

Source
pub struct Reborrow<'b, S: ?Sized, Tk: Token + ?Sized> { /* private fields */ }
Expand description

Stateful wrapper around a borrowed token shared reference.

Implementations§

Source§

impl<'b, S: ?Sized, Tk: Token + ?Sized> Reborrow<'b, S, Tk>

Source

pub fn reborrow<U: ?Sized>( &mut self, cell: impl FnOnce(&mut S) -> &TokenRefCell<U, Tk>, ) -> Ref<'_, U, Tk>

Uses borrowed token shared reference to reborrow a TokenRefCell.

§Panics

See TokenRefCell::borrow.

Source

pub fn try_reborrow<U: ?Sized>( &mut self, cell: impl FnOnce(&mut S) -> &TokenRefCell<U, Tk>, ) -> Result<Ref<'_, U, Tk>, BorrowError>

Uses borrowed token shared reference to reborrow a TokenRefCell.

See TokenRefCell::try_borrow.

Source

pub fn reborrow_opt<U: ?Sized>( &mut self, cell: impl FnOnce(&mut S) -> Option<&TokenRefCell<U, Tk>>, ) -> Option<Ref<'_, U, Tk>>

Uses borrowed token shared reference to optionally reborrow a TokenRefCell.

§Panics

See TokenRefCell::borrow.

Source

pub fn try_reborrow_opt<U: ?Sized>( &mut self, cell: impl FnOnce(&mut S) -> Option<&TokenRefCell<U, Tk>>, ) -> Option<Result<Ref<'_, U, Tk>, BorrowError>>

Uses borrowed token shared reference to optionally reborrow a TokenRefCell.

See TokenRefCell::try_borrow.

Source

pub fn token_id(&self) -> Tk::Id

Get the id of the borrowed token.

Trait Implementations§

Source§

impl<S: ?Sized + Debug, Tk: Token + ?Sized> Debug for Reborrow<'_, S, Tk>
where Tk::Id: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: ?Sized, Tk: Token + ?Sized> Deref for Reborrow<'_, S, Tk>

Source§

type Target = S

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<S: ?Sized, Tk: Token + ?Sized> DerefMut for Reborrow<'_, S, Tk>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'b, S, Tk> Freeze for Reborrow<'b, S, Tk>
where <Tk as Token>::Id: Freeze, S: Freeze + ?Sized, Tk: ?Sized,

§

impl<'b, S, Tk> RefUnwindSafe for Reborrow<'b, S, Tk>
where <Tk as Token>::Id: RefUnwindSafe, S: RefUnwindSafe + ?Sized, Tk: RefUnwindSafe + ?Sized,

§

impl<'b, S, Tk> Send for Reborrow<'b, S, Tk>
where <Tk as Token>::Id: Send, S: Send + ?Sized, Tk: Sync + ?Sized,

§

impl<'b, S, Tk> Sync for Reborrow<'b, S, Tk>
where <Tk as Token>::Id: Sync, S: Sync + ?Sized, Tk: Sync + ?Sized,

§

impl<'b, S, Tk> Unpin for Reborrow<'b, S, Tk>
where <Tk as Token>::Id: Unpin, S: Unpin + ?Sized, Tk: ?Sized,

§

impl<'b, S, Tk> UnwindSafe for Reborrow<'b, S, Tk>
where <Tk as Token>::Id: UnwindSafe, S: UnwindSafe + ?Sized, Tk: RefUnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.