pub enum Object {
Text(Line, RenderData),
Paragraph(Line),
Choice(PageKey, Vec<(u8, Line)>),
Image(Image),
Heading(Span, u8),
Break,
Empty(u8),
Note(Line, (u8, u8)),
Quote(Line, RenderData),
Custom(RenderData),
}Expand description
An object within a View.
The frontend is responsible for the display of each variant, but should adhere to their description in doing so.
Variants§
Text(Line, RenderData)
A single line, rendered with wrapping, carrying optional data which can be used for customization by the frontend.
N.B. spans are allowed to carry newlines.
Paragraph(Line)
Text with a single-spaced y-margin.
Choice(PageKey, Vec<(u8, Line)>)
A list of selectable texts which stores the selected index on click.
Like the paragraph variant, this includes a single-spaced y-margin
Image(Image)
See Image
Heading(Span, u8)
Markdown heading
Break
Horizontal line
<hr/>
Empty(u8)
empty lines.
Note(Line, (u8, u8))
Represents different types of notes.
Inputs:
Line: The content to display.(u8, u8): Indices into aSpanfromView[Line[Span]], e.g., for annotations.
Quote(Line, RenderData)
Quote style.
Custom(RenderData)
Custom marker. For example, can be used signal to the frontend to play music when this object enters the screen.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Object
impl !RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl !UnwindSafe for Object
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