Skip to main content

HtonCapabilities

Struct HtonCapabilities 

Source
#[non_exhaustive]
pub struct HtonCapabilities(/* private fields */);
Expand description

The set of engine-level features a Handlerton opts into.

Each capability gates a group of handlerton callbacks. A group will be wired into the handlerton struct only when its bit is set here, because MySQL reads a non-NULL function pointer as a declaration that the engine supports that feature — a non-NULL commit, for example, marks the engine transactional. Declaring a capability the engine does not implement would route work to callbacks that cannot honour it, so default to the smallest set that is actually backed by code.

Combine capabilities with |:

use mysql_handler::hton::HtonCapabilities;

let caps = HtonCapabilities::TRANSACTIONS | HtonCapabilities::SAVEPOINTS;
assert!(caps.contains(HtonCapabilities::TRANSACTIONS));
assert!(!caps.contains(HtonCapabilities::XA));

Implementations§

Source§

impl HtonCapabilities

Source

pub const TRANSACTIONS: Self

Transaction callbacks (commit, rollback, prepare)

Source

pub const XA: Self

XA / 2PC recovery callbacks (recover, commit_by_xid, …)

Source

pub const SAVEPOINTS: Self

Savepoint callbacks (savepoint_set, savepoint_rollback, …)

Source

pub const SDI: Self

Serialized Dictionary Information callbacks (sdi_*)

Source

pub const SECONDARY_ENGINE: Self

Secondary-engine callbacks (prepare_secondary_engine, …)

Source

pub const CLONE: Self

Clone-interface sub-callbacks

Source

pub const PAGE_TRACKING: Self

Page-tracking sub-callbacks

Source

pub const PARTITIONING: Self

Partitioning support: gates the partition_flags accessor on the handlerton. A non-NULL partition_flags pointer signals MySQL that the engine implements handler::get_partition_handler, so this must stay off for a non-partitioning engine.

Source

pub const TABLESPACES: Self

Tablespace ownership: gates the tablespace callbacks (get_tablespace, alter_tablespace, upgrade_tablespace, …). Non-NULL pointers tell MySQL the engine owns tablespaces (InnoDB-style); leave off for a tablespace-less engine to keep MySQL from routing tablespace work here.

Source

pub const DICT_BACKEND: Self

Data-dictionary backend: gates the dict_* callbacks. A non-DD-backend engine (anything other than the DD storage backend itself) must keep these unwired, otherwise MySQL routes dictionary work to an engine that cannot honour it.

Source

pub const ENGINE_LOG: Self

Engine-owned redo / transaction log: gates lock_hton_log, unlock_hton_log, collect_hton_log_info, and redo_log_set_state. Declared by engines whose log is collected by performance_schema.log_status.

Source

pub const ENCRYPTION: Self

Encryption support: gates rotate_encryption_master_key. Non-NULL signals MySQL that the engine participates in master-key rotation, so leave it off for a non-encrypting engine.

Source

pub const fn empty() -> Self

An empty capability set: a handler-only engine (the zero-config default)

Source

pub const fn bits(self) -> u32

The raw bits, for handing the set across the FFI boundary

Source

pub const fn contains(self, other: Self) -> bool

Whether every capability in other is present in self

Source

pub const fn union(self, other: Self) -> Self

The union of two capability sets

Trait Implementations§

Source§

impl BitOr for HtonCapabilities

Source§

type Output = HtonCapabilities

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
Source§

impl Clone for HtonCapabilities

Source§

fn clone(&self) -> HtonCapabilities

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for HtonCapabilities

Source§

impl Debug for HtonCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for HtonCapabilities

Source§

impl PartialEq for HtonCapabilities

Source§

fn eq(&self, other: &HtonCapabilities) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for HtonCapabilities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more