pub struct Card {
pub blocks: Vec<Block>,
}Expand description
What a hover card shows.
Fields§
§blocks: Vec<Block>Implementations§
Source§impl Card
impl Card
pub fn new() -> Self
Sourcepub fn text(self, text: impl Into<String>) -> Self
pub fn text(self, text: impl Into<String>) -> Self
Formatted text (**bold**, `code`, - list lines).
Sourcepub fn row(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn row(self, key: impl Into<String>, value: impl Into<String>) -> Self
A row of key and value; rows in a run make one table.
Sourcepub fn progress(self, label: impl Into<String>, fraction: Option<f32>) -> Self
pub fn progress(self, label: impl Into<String>, fraction: Option<f32>) -> Self
A progress line (None: indeterminate).
pub fn separator(self) -> Self
Sourcepub fn link(
self,
label: impl Into<String>,
command: CommandId,
args: Json,
) -> Self
pub fn link( self, label: impl Into<String>, command: CommandId, args: Json, ) -> Self
A command link; links in a run share a line.
pub fn is_empty(&self) -> bool
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
Its text without formatting, a line per line of text, row or progress: the anchor’s accessible description, and what an agent reads. Links are left out (they are buttons of their own).
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