pub enum Witness {
Default,
Function(*const c_void),
Metadata(*const c_void),
}Expand description
What to put in one slot of a witness table.
Variants§
Default
Use the default implementation the protocol descriptor records.
§Panics
At build time, if the requirement has no default.
Function(*const c_void)
A function implementing the requirement.
Metadata(*const c_void)
Metadata for an associated type, stored directly.
This is the form to use. SwiftUI’s own tables instead hold a pointer to a mangled name with bit 0 set — the runtime accepts either — but a name written here fails to demangle, because the blob the runtime expects is not a plain string: it carries symbolic references, which are relative pointers into the emitting image. Metadata needs no such context.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Witness
impl !Sync for Witness
impl Freeze for Witness
impl RefUnwindSafe for Witness
impl Unpin for Witness
impl UnsafeUnpin for Witness
impl UnwindSafe for Witness
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