#[repr(C)]pub struct Card {
pub content: Dom,
pub flex_grow: f32,
pub on_click: OptionCardOnClick,
}Expand description
An elevated, bordered content container with rounded corners, a soft drop
shadow and padding. Holds arbitrary child content (content).
Fields§
§content: DomThe body content rendered inside the card.
flex_grow: f32flex-grow factor applied to the card container.
on_click: OptionCardOnClickOptional: Function to call when the card is clicked
Implementations§
Source§impl Card
impl Card
Sourcepub const fn swap_with_default(&mut self) -> Self
pub const fn swap_with_default(&mut self) -> Self
Replaces self with an empty default card and returns the original.
Sourcepub fn set_content(&mut self, content: Dom)
pub fn set_content(&mut self, content: Dom)
Sets the body content.
Sourcepub fn with_content(self, content: Dom) -> Self
pub fn with_content(self, content: Dom) -> Self
Builder-style setter for the body content.
Sourcepub const fn set_flex_grow(&mut self, flex_grow: f32)
pub const fn set_flex_grow(&mut self, flex_grow: f32)
Sets the flex-grow factor for the card container.
Sourcepub const fn with_flex_grow(self, flex_grow: f32) -> Self
pub const fn with_flex_grow(self, flex_grow: f32) -> Self
Builder-style setter for the flex-grow factor.
Sourcepub fn set_on_click<C: Into<CardOnClickCallback>>(
&mut self,
data: RefAny,
on_click: C,
)
pub fn set_on_click<C: Into<CardOnClickCallback>>( &mut self, data: RefAny, on_click: C, )
Sets the click callback, invoked when the card container is clicked.
Sourcepub fn with_on_click<C: Into<CardOnClickCallback>>(
self,
data: RefAny,
on_click: C,
) -> Self
pub fn with_on_click<C: Into<CardOnClickCallback>>( self, data: RefAny, on_click: C, ) -> Self
Builder-style setter for the click callback.
pub fn dom(self) -> Dom
Trait Implementations§
impl StructuralPartialEq for Card
Auto Trait Implementations§
impl Freeze for Card
impl RefUnwindSafe for Card
impl Send for Card
impl Sync for Card
impl Unpin for Card
impl UnsafeUnpin for Card
impl UnwindSafe for Card
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more