pub struct SheetContent {
pub title: Option<String>,
pub message: Option<String>,
pub image: Option<Arc<[u8]>>,
pub actions: Vec<SheetAction>,
}Expand description
A sheet’s content — the constrained schema a native sheet renders with
platform views only (decision D4): a title, a message, an optional image
and up to MAX_SHEET_ACTIONS action rows, laid out top to bottom in
that order. Arbitrary frust content is deliberately not accepted: frust
has a single render root, and a platform_view slot never mounts inside
a presented controller.
Fields§
§title: Option<String>A bold headline; None (or empty) omits the row.
message: Option<String>Body text, wrapped over as many lines as it needs; None (or empty)
omits the row.
image: Option<Arc<[u8]>>Encoded image bytes (PNG/JPEG/HEIC — whatever the platform decodes), shown aspect-fit under the text. Bytes the platform cannot decode omit the row (logged), never fail the sheet.
actions: Vec<SheetAction>The action rows, in presentation order.
Implementations§
Source§impl SheetContent
impl SheetContent
Sourcepub fn new() -> Self
pub fn new() -> Self
Empty content — add rows with the with_* builders. Presenting it
empty is refused (SheetSpec::validate).
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set the title row.
Sourcepub fn with_message(self, message: impl Into<String>) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
Set the message row.
Sourcepub fn with_image(self, bytes: impl Into<Arc<[u8]>>) -> Self
pub fn with_image(self, bytes: impl Into<Arc<[u8]>>) -> Self
Set the image row from encoded bytes.
Sourcepub fn with_action(
self,
id: impl Into<String>,
label: impl Into<String>,
role: ActionRole,
) -> Self
pub fn with_action( self, id: impl Into<String>, label: impl Into<String>, role: ActionRole, ) -> Self
Append one action row.
Trait Implementations§
Source§impl Clone for SheetContent
impl Clone for SheetContent
Source§impl Debug for SheetContent
impl Debug for SheetContent
Source§impl Default for SheetContent
impl Default for SheetContent
impl Eq for SheetContent
Source§impl PartialEq for SheetContent
impl PartialEq for SheetContent
impl StructuralPartialEq for SheetContent
Auto Trait Implementations§
impl Freeze for SheetContent
impl RefUnwindSafe for SheetContent
impl Send for SheetContent
impl Sync for SheetContent
impl Unpin for SheetContent
impl UnsafeUnpin for SheetContent
impl UnwindSafe for SheetContent
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.