Skip to main content

Crate ravenrs_core

Crate ravenrs_core 

Source
Expand description

Foundation types shared by every RavenRS crate.

ravenrs-core has no dependencies. It defines logical-pixel geometry, colors, platform-neutral input events, Scene (the display list that widgets produce and renderers consume) and AccessTree (what assistive technology sees). Keeping them here lets widgets stay independent of any GPU or operating-system API. csv is here because the grid and the report exporters share nothing else lower down.

Modules§

csv
CSV fields (RFC 4180), written the same way by every engine that exports CSV.

Structs§

AccessNode
One node of the accessibility tree.
AccessTree
The whole accessibility tree of one window, as of the latest frame.
AdapterReport
One GPU as the graphics API describes it.
Border
A solid stroke drawn inside a shape’s edge.
BuildCauses
How many builds each BuildCause caused.
Color
A non-premultiplied RGBA color with components in 0.0..=1.0, in the sRGB color space (the space design tokens are written in).
ColorStop
A color along a gradient, from 0.0 to 1.0.
DiagnosticReport
Everything known about where an app runs, to read or to paste into a bug report.
Effect
A visual change applied to painted content without touching layout: what a compositor would do to a layer, here done to the display list.
FileStorage
Pieces of data kept as files in a folder on the desktop, one file per name. A write goes to a draft first and then takes the file’s place, so a crash never leaves half a file.
FontRef
Font bytes plus a stable identity used as a cache key by the glyph atlas.
FrameLog
The latest frames an app drew. Recording one is a push into a fixed buffer, so it can stay on while nobody is looking.
FrameSample
What one frame cost. All durations are time on the CPU: waiting for a busy GPU shows up in Self::acquire and Self::present, not in Self::render.
FrameSummary
The recent frames of a FrameLog, summed up.
FrameWork
What the UI runtime did for one frame.
GlyphRun
Shaped glyphs sharing one font, size and color.
GpuReport
The GPU an app ended up on and the ones it could have used.
ImageData
Decoded pixels: RGBA8, straight (not premultiplied) alpha, sRGB, row-major. Cloning is cheap; the renderer caches the GPU texture by id.
ImageQuad
An image drawn into a rectangle, with optional rounded corners.
Insets
Distances from each edge, used for padding.
LinearGradient
A two-stop linear gradient. start and end are relative to the shape’s rectangle: (0, 0) is its top-left corner and (1, 1) its bottom-right.
MemoryStorage
Pieces of data kept in memory, gone when the program ends: for tests and previews.
Modifiers
Modifier keys held during a key event.
NumericValue
A numeric value with its range (sliders, spin buttons, progress).
PathClip
What a PathFill is seen through, in the same coordinates: another outline.
PathFill
A shape made of curves, filled with exact coverage at each pixel, so it stays sharp at any size. A stroke is a fill of its expanded outline.
Percentiles
The median and the 95th percentile of a duration.
PerformanceResult
What redrawing the window nonstop for a few seconds showed.
PhaseTimes
Time spent in each phase of the UI runtime, once a clock was given to it.
Point
A point in logical pixels, origin at the top-left corner.
PositionedGlyph
One shaped glyph and its pen position.
Quad
A rounded rectangle with optional border and shadow. The renderer draws it with a signed-distance function, so corners stay crisp at any scale factor.
Rect
An axis-aligned rectangle in logical pixels.
RenderWork
What the renderer’s resources looked like after a frame.
Scene
An ordered display list. Reused between frames to avoid reallocating.
Shadow
A soft drop shadow. blur is the Gaussian standard deviation times two, matching what CSS box-shadow calls the blur radius.
Size
A size in logical pixels.
SurfaceReport
How frames reach the window.
SystemReport
The machine and the build around the GPU.
ViewCost
What a type of view cost in the latest build, not counting the views inside it.

Enums§

AccessAction
What assistive technology can ask a node to do.
Bottleneck
Where the time of a slow frame goes.
Brush
How a shape is filled.
BuildCause
Why the views ran again. It is the first question about a slow screen: every rebuild costs in proportion to the whole screen.
CursorIcon
Cursor the UI asks the platform to show.
DiagnosticFinding
Something in a DiagnosticReport that explains a slow or broken app.
Event
Platform-neutral input event, already converted to logical pixels.
FillRule
Which parts of a self-crossing outline count as inside.
Key
The subset of keys the framework itself reacts to; everything else is forwarded as Character or Other for widgets to interpret.
PathElement
One step of a PathFill’s outline.
PathPaint
What fills a PathFill, in the coordinates of its outline.
PerformanceVerdict
How a PerformanceResult feels to the person using the app.
PointerButton
Mouse button or equivalent touch/pen action.
Primitive
One entry of the display list.
Role
What kind of control or content a node is, as assistive technology names it.
Toggled
State of a check box, switch or toggle button.

Constants§

MAX_ISSUE_URL
The longest URL new_issue_url builds. Servers answer longer ones with an error instead of the page, and GitHub’s limit is not documented, so this stays well under the 8 KB many servers allow.

Traits§

Storage
Named pieces of data kept between runs.

Functions§

monotone_slopes
The slope at each of points (in order, with growing x) of a curve that never swings past them: Fritsch-Carlson, with a harmonic mean. Charts and curve editors share it so that a curve reads the same in both. Fewer than two points have no slope to speak of, so they get zeros.
new_issue_url
The URL of a new issue with intro and then report in a code block as its body, for the person to review and send on the page it opens. It never passes MAX_ISSUE_URL: a report that would make it longer loses its last lines, whole where possible, and truncated_note says so after the block.
redact_user_paths
text with every path inside a person’s own folder replaced, since those paths usually carry the person’s name. A path can have spaces, so what follows goes up to the end of the line or a quote or list separator: too much hidden is better than a surname left behind.