[][src]Trait wiggle::GuestTypeTransparent

pub unsafe trait GuestTypeTransparent<'a>: GuestType<'a> {
    fn validate(ptr: *mut Self) -> Result<(), GuestError>;
}

A trait for GuestTypes that have the same representation in guest memory as in Rust. These types can be used with the GuestPtr::as_raw method to view as a slice.

Unsafe trait because a correct GuestTypeTransparent implemengation ensures that the GuestPtr::as_raw methods are safe. This trait should only ever be implemented by wiggle_generate-produced code.

Required methods

fn validate(ptr: *mut Self) -> Result<(), GuestError>

Checks that the memory at ptr is a valid representation of Self.

Assumes that memory safety checks have already been performed: ptr has been checked to be aligned correctly and reside in memory using GuestMemory::validate_size_align

Loading content...

Implementations on Foreign Types

impl<'a> GuestTypeTransparent<'a> for i8[src]

impl<'a> GuestTypeTransparent<'a> for i16[src]

impl<'a> GuestTypeTransparent<'a> for i32[src]

impl<'a> GuestTypeTransparent<'a> for i64[src]

impl<'a> GuestTypeTransparent<'a> for i128[src]

impl<'a> GuestTypeTransparent<'a> for u8[src]

impl<'a> GuestTypeTransparent<'a> for u16[src]

impl<'a> GuestTypeTransparent<'a> for u32[src]

impl<'a> GuestTypeTransparent<'a> for u64[src]

impl<'a> GuestTypeTransparent<'a> for u128[src]

impl<'a> GuestTypeTransparent<'a> for f32[src]

impl<'a> GuestTypeTransparent<'a> for f64[src]

Loading content...

Implementors

Loading content...