Expand description
Vtable for type-erased attachment operations.
This module contains the AttachmentVtable which enables calling handler
methods on attachments when their concrete attachment type A and handler
type H have been erased. The vtable stores function pointers that dispatch
to the correct typed implementations.
This module encapsulates the fields of the AttachmentVtable so that they
cannot be accessed directly without going through the proper methods which
specifies which safety invariants are required to call them safely.
Structs§
- Attachment
Vtable 🔒 - Vtable for type-erased attachment operations.
Functions§
- debug 🔒 ⚠
- Formats an attachment using its handler’s debug implementation.
- display 🔒 ⚠
- Formats an attachment using its handler’s display implementation.
- drop 🔒 ⚠
- Drops the
Box<AttachmentData<A>>instance pointed to by this pointer. - preferred_
formatting_ 🔒 ⚠style - Gets the preferred formatting style using the
H::preferred_formatting_stylefunction.