Skip to main content

OpaqueBorrow

Struct OpaqueBorrow 

Source
#[repr(transparent)]
pub struct OpaqueBorrow<'facet, T>(pub T, _);
Expand description

Lifetime-aware wrapper used for field-level #[facet(opaque)].

This lets derive-generated shapes describe borrowed opaque fields without requiring 'static, while still tying the wrapper to the active Facet lifetime.

Tuple Fields§

§0: T

Implementations§

Source§

impl<'facet, T> OpaqueBorrow<'facet, T>

Source

pub const fn new(value: T) -> Self

Creates a new lifetime-aware opaque wrapper.

Trait Implementations§

Source§

impl<'facet, T: Default> Default for OpaqueBorrow<'facet, T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'facet, T: 'facet> Facet<'facet> for OpaqueBorrow<'facet, T>

Source§

const SHAPE: &'static Shape

The shape of this type, including: whether it’s a Struct, an Enum, something else? Read more

Auto Trait Implementations§

§

impl<'facet, T> Freeze for OpaqueBorrow<'facet, T>
where T: Freeze,

§

impl<'facet, T> RefUnwindSafe for OpaqueBorrow<'facet, T>
where T: RefUnwindSafe,

§

impl<'facet, T> Send for OpaqueBorrow<'facet, T>
where T: Send,

§

impl<'facet, T> Sync for OpaqueBorrow<'facet, T>
where T: Sync,

§

impl<'facet, T> Unpin for OpaqueBorrow<'facet, T>
where T: Unpin,

§

impl<'facet, T> UnsafeUnpin for OpaqueBorrow<'facet, T>
where T: UnsafeUnpin,

§

impl<'facet, T> UnwindSafe for OpaqueBorrow<'facet, T>
where T: UnwindSafe,

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<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.