Trait Encode

Source
pub unsafe trait Encode {
    const ENCODING: Encoding<'static>;
}
Expand description

Types that have an Objective-C type encoding.

Unsafe because Objective-C will make assumptions about the type (like its size and alignment) from its encoding, so the implementer must verify that the encoding is accurate.

Required Associated Constants§

Source

const ENCODING: Encoding<'static>

Returns the Objective-C type encoding for Self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Encode for bool

Source§

const ENCODING: Encoding<'static> = Encoding::Bool

Source§

impl Encode for f32

Source§

const ENCODING: Encoding<'static> = Encoding::Float

Source§

impl Encode for f64

Source§

const ENCODING: Encoding<'static> = Encoding::Double

Source§

impl Encode for i8

Source§

const ENCODING: Encoding<'static> = Encoding::Char

Source§

impl Encode for i16

Source§

const ENCODING: Encoding<'static> = Encoding::Short

Source§

impl Encode for i32

Source§

const ENCODING: Encoding<'static> = Encoding::Int

Source§

impl Encode for i64

Source§

const ENCODING: Encoding<'static> = Encoding::LongLong

Source§

impl Encode for isize

Source§

const ENCODING: Encoding<'static> = i32::ENCODING

Source§

impl Encode for *const c_void

Source§

const ENCODING: Encoding<'static>

Source§

impl Encode for *const i8

Source§

const ENCODING: Encoding<'static> = Encoding::String

Source§

impl Encode for *const u8

Source§

const ENCODING: Encoding<'static> = Encoding::String

Source§

impl Encode for *mut c_void

Source§

const ENCODING: Encoding<'static>

Source§

impl Encode for *mut i8

Source§

const ENCODING: Encoding<'static> = Encoding::String

Source§

impl Encode for *mut u8

Source§

const ENCODING: Encoding<'static> = Encoding::String

Source§

impl Encode for u8

Source§

const ENCODING: Encoding<'static> = Encoding::UChar

Source§

impl Encode for u16

Source§

const ENCODING: Encoding<'static> = Encoding::UShort

Source§

impl Encode for u32

Source§

const ENCODING: Encoding<'static> = Encoding::UInt

Source§

impl Encode for u64

Source§

const ENCODING: Encoding<'static> = Encoding::ULongLong

Source§

impl Encode for ()

Source§

const ENCODING: Encoding<'static> = Encoding::Void

Source§

impl Encode for usize

Source§

const ENCODING: Encoding<'static> = u32::ENCODING

Source§

impl<'a, T: 'a> Encode for Option<&'a T>
where &'a T: Encode,

Source§

const ENCODING: Encoding<'static> = <&T>::ENCODING

Source§

impl<'a, T: 'a> Encode for Option<&'a mut T>

Source§

const ENCODING: Encoding<'static> = <&mut T>::ENCODING

Source§

impl<T: 'static> Encode for *const T
where for<'a> &'a T: Encode,

Source§

const ENCODING: Encoding<'static> = <&T as Encode>::ENCODING

Source§

impl<T: 'static> Encode for *mut T
where for<'a> &'a mut T: Encode,

Source§

const ENCODING: Encoding<'static> = <&mut T>::ENCODING

Source§

impl<T: Encode> Encode for [T; 1]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 2]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 3]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 4]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 5]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 6]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 7]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 8]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 9]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 10]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 11]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 12]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 13]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 14]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 15]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 16]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 17]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 18]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 19]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 20]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 21]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 22]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 23]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 24]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 25]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 26]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 27]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 28]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 29]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 30]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 31]

Source§

const ENCODING: Encoding<'static>

Source§

impl<T: Encode> Encode for [T; 32]

Source§

const ENCODING: Encoding<'static>

Implementors§