[][src]Trait opaque_typedef::OpaqueTypedef

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

Common functions for opaque typedef-ed sized types.

Associated Types

type Inner

Inner type.

type Error: Debug

Validation error type.

Loading content...

Required methods

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

Creates a new value from the inner value without validation.

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

Tries to create a new value from the inner value with validation.

fn into_inner(self) -> Self::Inner

Takes and returns the inner value with its ownership.

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

Returns the reference to the inner value.

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

Returns the mutable reference to the inner value.

Loading content...

Provided methods

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

Creates a new value from the inner value with validation.

Panics

Panics if the validation failed.

Loading content...

Implementors

Loading content...