[][src]Trait opaque_typedef::OpaqueTypedefUnsized

pub trait OpaqueTypedefUnsized {
    type Inner: ?Sized;
    type Error: Debug;
    unsafe fn from_inner_unchecked(inner: &Self::Inner) -> &Self;
unsafe fn from_inner_unchecked_mut(inner: &mut Self::Inner) -> &mut Self;
fn try_from_inner(inner: &Self::Inner) -> Result<&Self, Self::Error>;
fn try_from_inner_mut(
        inner: &mut Self::Inner
    ) -> Result<&mut Self, Self::Error>;
fn as_inner(&self) -> &Self::Inner;
unsafe fn as_inner_mut(&mut self) -> &mut Self::Inner; fn from_inner(inner: &Self::Inner) -> &Self { ... }
fn from_inner_mut(inner: &mut Self::Inner) -> &mut Self { ... } }

Common functions for opaque typedef-ed unsized types.

Associated Types

type Inner: ?Sized

Inner type.

type Error: Debug

Validation error type.

Loading content...

Required methods

unsafe fn from_inner_unchecked(inner: &Self::Inner) -> &Self

Creates a reference from the inner reference without validation.

unsafe fn from_inner_unchecked_mut(inner: &mut Self::Inner) -> &mut Self

Creates a mutable reference from the inner mutable reference without validation.

fn try_from_inner(inner: &Self::Inner) -> Result<&Self, Self::Error>

Tries to create a reference from the inner reference with validation.

fn try_from_inner_mut(inner: &mut Self::Inner) -> Result<&mut Self, Self::Error>

Tries to create a mutable reference from the inner mutable reference with validation.

fn as_inner(&self) -> &Self::Inner

Returns the inner reference.

unsafe fn as_inner_mut(&mut self) -> &mut Self::Inner

Returns the inner mutable reference.

Loading content...

Provided methods

fn from_inner(inner: &Self::Inner) -> &Self

Creates a reference from the inner reference with validation.

Panics

Panics if the validation failed.

fn from_inner_mut(inner: &mut Self::Inner) -> &mut Self

Creates a mutable reference from the inner mutable reference with validation.

Panics

Panics if the validation failed.

Loading content...

Implementors

Loading content...