#[repr(C)]
pub struct CustomOps { pub identifier: *const Char, pub finalize: Option<unsafe extern "C" fn(v: Raw)>, pub compare: Option<unsafe extern "C" fn(v1: Raw, v2: Raw) -> i32>, pub hash: Option<unsafe extern "C" fn(v: Raw) -> Int>, pub serialize: Option<unsafe extern "C" fn(v: Raw, bsize_32: *mut Uint, bsize_64: *mut Uint)>, pub deserialize: Option<unsafe extern "C" fn(dst: *mut c_void) -> Uint>, pub compare_ext: Option<unsafe extern "C" fn(v1: Raw, v2: Raw) -> i32>, pub fixed_length: *const custom_fixed_length, }
Expand description

CustomOps duplicates sys::custom::custom_operations to provide a slightly nicer experience in Rust

This should rarely be constructed manually, custom! simplifies the process of creating custom types.

See the struct custom_operations section in the OCaml manual for more information about each field

Fields

identifier: *const Charfinalize: Option<unsafe extern "C" fn(v: Raw)>compare: Option<unsafe extern "C" fn(v1: Raw, v2: Raw) -> i32>hash: Option<unsafe extern "C" fn(v: Raw) -> Int>serialize: Option<unsafe extern "C" fn(v: Raw, bsize_32: *mut Uint, bsize_64: *mut Uint)>deserialize: Option<unsafe extern "C" fn(dst: *mut c_void) -> Uint>compare_ext: Option<unsafe extern "C" fn(v1: Raw, v2: Raw) -> i32>fixed_length: *const custom_fixed_length

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.