pub struct ModelCard { /* private fields */ }Expand description
ModelCard widget for displaying ML model metadata.
Implementations§
Source§impl ModelCard
impl ModelCard
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set description.
Sourcepub const fn status(self, status: ModelStatus) -> Self
pub const fn status(self, status: ModelStatus) -> Self
Set status.
Sourcepub fn metric(self, metric: ModelMetric) -> Self
pub fn metric(self, metric: ModelMetric) -> Self
Add a metric.
Sourcepub fn metrics(self, metrics: impl IntoIterator<Item = ModelMetric>) -> Self
pub fn metrics(self, metrics: impl IntoIterator<Item = ModelMetric>) -> Self
Add multiple metrics.
Sourcepub const fn parameters(self, count: u64) -> Self
pub const fn parameters(self, count: u64) -> Self
Set parameter count.
Set author.
Add multiple tags.
Sourcepub fn metadata_entry(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn metadata_entry( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add custom metadata.
Sourcepub const fn background(self, color: Color) -> Self
pub const fn background(self, color: Color) -> Self
Set background color.
Sourcepub const fn border_color(self, color: Color) -> Self
pub const fn border_color(self, color: Color) -> Self
Set border color.
Sourcepub fn corner_radius(self, radius: f32) -> Self
pub fn corner_radius(self, radius: f32) -> Self
Set corner radius.
Sourcepub const fn show_metrics_chart(self, show: bool) -> Self
pub const fn show_metrics_chart(self, show: bool) -> Self
Set whether to show metrics chart.
Sourcepub fn accessible_name(self, name: impl Into<String>) -> Self
pub fn accessible_name(self, name: impl Into<String>) -> Self
Set accessible name.
Sourcepub fn get_version(&self) -> &str
pub fn get_version(&self) -> &str
Get version.
Sourcepub fn get_description(&self) -> Option<&str>
pub fn get_description(&self) -> Option<&str>
Get description.
Sourcepub const fn get_status(&self) -> ModelStatus
pub const fn get_status(&self) -> ModelStatus
Get status.
Sourcepub fn get_framework(&self) -> Option<&str>
pub fn get_framework(&self) -> Option<&str>
Get framework.
Sourcepub fn get_metrics(&self) -> &[ModelMetric]
pub fn get_metrics(&self) -> &[ModelMetric]
Get metrics.
Sourcepub const fn get_parameters(&self) -> Option<u64>
pub const fn get_parameters(&self) -> Option<u64>
Get parameter count.
Sourcepub fn get_dataset(&self) -> Option<&str>
pub fn get_dataset(&self) -> Option<&str>
Get dataset.
Get author.
Get tags.
Sourcepub fn get_metadata(&self, key: &str) -> Option<&str>
pub fn get_metadata(&self, key: &str) -> Option<&str>
Get custom metadata.
Sourcepub fn has_metrics(&self) -> bool
pub fn has_metrics(&self) -> bool
Check if model has metrics.
Sourcepub fn formatted_parameters(&self) -> Option<String>
pub fn formatted_parameters(&self) -> Option<String>
Format parameter count for display.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModelCard
impl<'de> Deserialize<'de> for ModelCard
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Widget for ModelCard
impl Widget for ModelCard
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints. Read more
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds. Read more
Source§fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>
fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>
Handle input events. Read more
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Auto Trait Implementations§
impl Freeze for ModelCard
impl RefUnwindSafe for ModelCard
impl Send for ModelCard
impl Sync for ModelCard
impl Unpin for ModelCard
impl UnwindSafe for ModelCard
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)