Trait Capable

Source
pub unsafe trait Capable {
    // Required method
    fn vtable(capability: TypeId) -> Option<NonNull<()>>;
}
Expand description

Used to cast an element to a trait object for a trait it implements.

§Safety

If the vtable function returns Some(p), then p must be a valid pointer to a vtable of Packed<Self> w.r.t to the trait C where capability is TypeId::of::<dyn C>().

Required Methods§

Source

fn vtable(capability: TypeId) -> Option<NonNull<()>>

Get the pointer to the vtable for the given capability / trait.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Capable for FrameElem

Source§

impl Capable for HtmlElem

Source§

impl Capable for CounterDisplayElem

Source§

impl Capable for MetadataElem

Source§

impl Capable for TagElem

Source§

impl Capable for GridCell

Source§

impl Capable for GridElem

Source§

impl Capable for GridFooter

Source§

impl Capable for GridHLine

Source§

impl Capable for GridHeader

Source§

impl Capable for GridVLine

Source§

impl Capable for AlignElem

Source§

impl Capable for BlockElem

Source§

impl Capable for BoxElem

Source§

impl Capable for ColbreakElem

Source§

impl Capable for ColumnsElem

Source§

impl Capable for FlushElem

Source§

impl Capable for HElem

Source§

impl Capable for HideElem

Source§

impl Capable for InlineElem

Source§

impl Capable for MoveElem

Source§

impl Capable for PadElem

Source§

impl Capable for PageElem

Source§

impl Capable for PagebreakElem

Source§

impl Capable for PlaceElem

Source§

impl Capable for RepeatElem

Source§

impl Capable for RotateElem

Source§

impl Capable for ScaleElem

Source§

impl Capable for SkewElem

Source§

impl Capable for StackElem

Source§

impl Capable for VElem

Source§

impl Capable for AccentElem

Source§

impl Capable for AlignPointElem

Source§

impl Capable for AttachElem

Source§

impl Capable for BinomElem

Source§

impl Capable for CancelElem

Source§

impl Capable for CasesElem

Source§

impl Capable for ClassElem

Source§

impl Capable for EquationElem

Source§

impl Capable for FracElem

Source§

impl Capable for LimitsElem

Source§

impl Capable for LrElem

Source§

impl Capable for MatElem

Source§

impl Capable for MidElem

Source§

impl Capable for OpElem

Source§

impl Capable for OverbraceElem

Source§

impl Capable for OverbracketElem

Source§

impl Capable for typst_library::math::OverlineElem

Source§

impl Capable for OverparenElem

Source§

impl Capable for OvershellElem

Source§

impl Capable for PrimesElem

Source§

impl Capable for RootElem

Source§

impl Capable for ScriptsElem

Source§

impl Capable for StretchElem

Source§

impl Capable for UnderbraceElem

Source§

impl Capable for UnderbracketElem

Source§

impl Capable for typst_library::math::UnderlineElem

Source§

impl Capable for UnderparenElem

Source§

impl Capable for UndershellElem

Source§

impl Capable for VecElem

Source§

impl Capable for BibliographyElem

Source§

impl Capable for CiteElem

Source§

impl Capable for CiteGroup

Source§

impl Capable for DocumentElem

Source§

impl Capable for EmphElem

Source§

impl Capable for EnumElem

Source§

impl Capable for EnumItem

Source§

impl Capable for FigureCaption

Source§

impl Capable for FigureElem

Source§

impl Capable for FootnoteElem

Source§

impl Capable for FootnoteEntry

Source§

impl Capable for HeadingElem

Source§

impl Capable for LinkElem

Source§

impl Capable for ListElem

Source§

impl Capable for ListItem

Source§

impl Capable for OutlineElem

Source§

impl Capable for OutlineEntry

Source§

impl Capable for ParElem

Source§

impl Capable for ParLine

Source§

impl Capable for ParLineMarker

Source§

impl Capable for ParbreakElem

Source§

impl Capable for QuoteElem

Source§

impl Capable for RefElem

Source§

impl Capable for StrongElem

Source§

impl Capable for TableCell

Source§

impl Capable for TableElem

Source§

impl Capable for TableFooter

Source§

impl Capable for TableHLine

Source§

impl Capable for TableHeader

Source§

impl Capable for TableVLine

Source§

impl Capable for TermItem

Source§

impl Capable for TermsElem

Source§

impl Capable for EmbedElem

Source§

impl Capable for HighlightElem

Source§

impl Capable for LinebreakElem

Source§

impl Capable for typst_library::text::OverlineElem

Source§

impl Capable for RawElem

Source§

impl Capable for RawLine

Source§

impl Capable for SmallcapsElem

Source§

impl Capable for SmartQuoteElem

Source§

impl Capable for SpaceElem

Source§

impl Capable for StrikeElem

Source§

impl Capable for SubElem

Source§

impl Capable for SuperElem

Source§

impl Capable for TextElem

Source§

impl Capable for typst_library::text::UnderlineElem

Source§

impl Capable for CircleElem

Source§

impl Capable for CurveClose

Source§

impl Capable for CurveCubic

Source§

impl Capable for CurveElem

Source§

impl Capable for CurveLine

Source§

impl Capable for CurveMove

Source§

impl Capable for CurveQuad

Source§

impl Capable for EllipseElem

Source§

impl Capable for ImageElem

Source§

impl Capable for LineElem

Source§

impl Capable for PathElem

Source§

impl Capable for PolygonElem

Source§

impl Capable for RectElem

Source§

impl Capable for SquareElem

Source§

impl Capable for ContextElem

Source§

impl Capable for SequenceElem

Source§

impl Capable for StyledElem

Source§

impl Capable for SymbolElem

Source§

impl Capable for TargetElem