#[repr(C)]pub(super) struct AttachmentData<A: 'static> {
vtable: &'static AttachmentVtable,
attachment: A,
}Expand description
Type-erased attachment data structure with vtable-based dispatch.
This struct uses #[repr(C)] to enable safe field access in type-erased contexts,
allowing access to the vtable field even when the concrete attachment type A is unknown.
Fields§
§vtable: &'static AttachmentVtable§attachment: AImplementations§
Source§impl<A: 'static> AttachmentData<A>
impl<A: 'static> AttachmentData<A>
Sourcepub(super) fn new<H: AttachmentHandler<A>>(attachment: A) -> Self
pub(super) fn new<H: AttachmentHandler<A>>(attachment: A) -> Self
Creates a new AttachmentData with the specified handler and attachment.
This method creates the vtable for type-erased dispatch and pairs it with the attachment data.
Auto Trait Implementations§
impl<A> Freeze for AttachmentData<A>where
A: Freeze,
impl<A> RefUnwindSafe for AttachmentData<A>where
A: RefUnwindSafe,
impl<A> Send for AttachmentData<A>where
A: Send,
impl<A> Sync for AttachmentData<A>where
A: Sync,
impl<A> Unpin for AttachmentData<A>where
A: Unpin,
impl<A> UnwindSafe for AttachmentData<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more