Skip to main content

Crate litehtml

Crate litehtml 

Source
Expand description

Safe Rust bindings for the litehtml HTML/CSS rendering engine.

This crate wraps the raw C FFI provided by litehtml-sys with safe, idiomatic Rust types. Users implement the DocumentContainer trait to provide font metrics, drawing, and resource loading, then create a Document to parse and render HTML.

Re-exports§

pub use litehtml_sys as sys;

Modules§

selection
Text selection support for litehtml documents.

Structs§

BackgroundLayer
Borrowed reference to a background layer from litehtml.
Border
BorderRadiuses
Borders
Color
RGBA color value.
ColorPoint
ConicGradient
Borrowed reference to a conic gradient from litehtml.
Document
A parsed HTML document. Wraps the C++ litehtml::document and ties its lifetime to the DocumentContainer that provides rendering callbacks.
Element
Opaque handle to a litehtml element. Borrows from the parent Document.
FontDescription
Borrowed reference to a font description from litehtml.
FontMetrics
LinearGradient
Borrowed reference to a linear gradient from litehtml.
ListMarker
Borrowed reference to a list marker from litehtml.
MediaFeatures
Point
Position
RadialGradient
Borrowed reference to a radial gradient from litehtml.
Size

Enums§

BorderStyle
ColorSpace
CSS gradient color interpolation space.
CreateError
Error returned by Document::from_html when document creation fails.
DecorationThickness
CSS text-decoration-thickness computed value.
HueInterpolation
CSS gradient hue interpolation method.
MediaType
MouseEvent
TextDecorationStyle
CSS text-decoration-style values.
TextTransform

Traits§

DocumentContainer
Trait that must be implemented to provide drawing, font, and resource callbacks to the litehtml rendering engine.

Functions§

css_escape_ident
Escape CSS meta-characters in an identifier for use in selectors.