Skip to main content

Sheet

Struct Sheet 

Source
pub struct Sheet<Node, Message> {
    pub content: Node,
    pub edge: SheetEdge,
    pub size: SheetSize,
    /* private fields */
}
Expand description

A panel that slides in from one of the window edges.

Like Dialog, a sheet is content only. The dim backdrop and its outside-click-to-close behavior are owned by the parent crate::AppLayout.

§Builder usage

use snora_core::{Sheet, SheetEdge, SheetSize};

// Use `()` for the content/message parameters when illustrating the
// shape only. In application code these are `iced::Element<'_, M>` and
// your `Message` type.
let sheet: Sheet<(), ()> = Sheet::new(())
    .at(SheetEdge::Start)
    .with_size(SheetSize::Half);

assert_eq!(sheet.edge, SheetEdge::Start);
assert_eq!(sheet.size, SheetSize::Half);

Fields§

§content: Node

The sheet’s body content. The engine wraps this in a styled surface sized according to size and anchored to edge.

§edge: SheetEdge

Where the sheet attaches. Defaults to SheetEdge::Bottom.

§size: SheetSize

Size of the sheet along the axis perpendicular to edge. Defaults to SheetSize::DEFAULT.

Implementations§

Source§

impl<Node, Message> Sheet<Node, Message>

Source

pub fn new(content: Node) -> Self

Build a sheet with default edge (SheetEdge::Bottom) and size (SheetSize::DEFAULT).

Source

pub fn at(self, edge: SheetEdge) -> Self

Override the anchor edge.

Source

pub fn with_size(self, size: SheetSize) -> Self

Override the size.

Auto Trait Implementations§

§

impl<Node, Message> Freeze for Sheet<Node, Message>
where Node: Freeze, PhantomData<Message>: Freeze,

§

impl<Node, Message> RefUnwindSafe for Sheet<Node, Message>
where Node: RefUnwindSafe, PhantomData<Message>: RefUnwindSafe,

§

impl<Node, Message> Send for Sheet<Node, Message>
where Node: Send, PhantomData<Message>: Send,

§

impl<Node, Message> Sync for Sheet<Node, Message>
where Node: Sync, PhantomData<Message>: Sync,

§

impl<Node, Message> Unpin for Sheet<Node, Message>
where Node: Unpin, PhantomData<Message>: Unpin,

§

impl<Node, Message> UnsafeUnpin for Sheet<Node, Message>
where Node: UnsafeUnpin, PhantomData<Message>: UnsafeUnpin,

§

impl<Node, Message> UnwindSafe for Sheet<Node, Message>
where Node: UnwindSafe, PhantomData<Message>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.