pub unsafe trait Context: Sealed {
    const FLAGS: u32;
    const DESCRIPTION: &'static str;

    // Required method
    unsafe fn deallocate(ptr: *mut u8, size: usize);
}
Expand description

A trait for all kinds of contexts that lets you define the exact flags and a function to deallocate memory. It isn’t possible to implement this for types outside this crate.

Safety

This trait is marked unsafe to allow unsafe implementations of deallocate.

Required Associated Constants§

source

const FLAGS: u32

Flags for the ffi.

source

const DESCRIPTION: &'static str

A constant description of the context.

Required Methods§

source

unsafe fn deallocate(ptr: *mut u8, size: usize)

A function to deallocate the memory when the context is dropped.

Safety

ptr must be valid. Further safety constraints may be imposed by std::alloc::dealloc.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Context for All

source§

const FLAGS: u32 = 769u32

source§

const DESCRIPTION: &'static str = "all capabilities"

source§

impl Context for SignOnly

source§

const FLAGS: u32 = 513u32

source§

const DESCRIPTION: &'static str = "signing only"

source§

impl Context for VerifyOnly

source§

const FLAGS: u32 = 257u32

source§

const DESCRIPTION: &'static str = "verification only"

source§

impl<'buf> Context for AllPreallocated<'buf>

source§

const FLAGS: u32 = 769u32

source§

const DESCRIPTION: &'static str = "all capabilities"

source§

impl<'buf> Context for SignOnlyPreallocated<'buf>

source§

const FLAGS: u32 = 513u32

source§

const DESCRIPTION: &'static str = "signing only"

source§

impl<'buf> Context for VerifyOnlyPreallocated<'buf>

source§

const FLAGS: u32 = 257u32

source§

const DESCRIPTION: &'static str = "verification only"