Skip to main content

InRef

Struct InRef 

pub struct InRef<'a, T: Type<T>>(/* private fields */);
Expand description

A borrowed ABI-compatible input parameter.

Implementations§

§

impl<T: Type<T>> InRef<'_, T>

pub fn is_null(&self) -> bool

Returns true if the argument is null.

pub fn ok(&self) -> Result<&T>

Returns the referenced value or E_POINTER if null.

pub fn as_ref(&self) -> Option<&T>

Returns the referenced value if non-null.

pub fn unwrap(&self) -> &T

Returns the referenced value.

§Panics

Panics if the argument is null.

pub fn cloned(&self) -> Option<T>

Converts the argument to an Option<T> by cloning the reference.

Trait Implementations§

§

impl<T: Type<T>> Default for InRef<'_, T>

§

fn default() -> Self

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

impl<T: Type<T>> Deref for InRef<'_, T>

§

type Target = <T as Type<T>>::Default

The resulting type after dereferencing.
§

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

Dereferences the value.
§

impl<'a, T> From<&'a Option<T>> for InRef<'a, T>
where T: TypeKind<TypeKind = InterfaceType> + Type<T, InterfaceType>,

§

fn from(from: &'a Option<T>) -> Self

Converts to this type from the input type.
§

impl<'a, T: Type<T>> From<&'a T> for InRef<'a, T>

§

fn from(from: &'a T) -> Self

Converts to this type from the input type.
§

impl<'a, T> From<Option<&'a T>> for InRef<'a, T>
where T: TypeKind<TypeKind = InterfaceType> + Type<T, InterfaceType>,

§

fn from(from: Option<&'a T>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, T> Freeze for InRef<'a, T>
where <T as Type<T>>::Abi: Freeze, PhantomData<&'a T>: Freeze,

§

impl<'a, T> RefUnwindSafe for InRef<'a, T>
where <T as Type<T>>::Abi: RefUnwindSafe, PhantomData<&'a T>: RefUnwindSafe,

§

impl<'a, T> Send for InRef<'a, T>
where <T as Type<T>>::Abi: Send, PhantomData<&'a T>: Send,

§

impl<'a, T> Sync for InRef<'a, T>
where <T as Type<T>>::Abi: Sync, PhantomData<&'a T>: Sync,

§

impl<'a, T> Unpin for InRef<'a, T>
where <T as Type<T>>::Abi: Unpin, PhantomData<&'a T>: Unpin,

§

impl<'a, T> UnsafeUnpin for InRef<'a, T>
where <T as Type<T>>::Abi: UnsafeUnpin, PhantomData<&'a T>: UnsafeUnpin,

§

impl<'a, T> UnwindSafe for InRef<'a, T>
where <T as Type<T>>::Abi: UnwindSafe, PhantomData<&'a 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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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.