ModelCard

Struct ModelCard 

Source
pub struct ModelCard { /* private fields */ }
Expand description

ModelCard widget for displaying ML model metadata.

Implementations§

Source§

impl ModelCard

Source

pub fn new(name: impl Into<String>) -> Self

Create a new model card.

Source

pub fn name(self, name: impl Into<String>) -> Self

Set model name.

Source

pub fn version(self, version: impl Into<String>) -> Self

Set version.

Source

pub fn description(self, desc: impl Into<String>) -> Self

Set description.

Source

pub const fn status(self, status: ModelStatus) -> Self

Set status.

Source

pub fn framework(self, framework: impl Into<String>) -> Self

Set framework.

Source

pub fn task(self, task: impl Into<String>) -> Self

Set task.

Source

pub fn metric(self, metric: ModelMetric) -> Self

Add a metric.

Source

pub fn metrics(self, metrics: impl IntoIterator<Item = ModelMetric>) -> Self

Add multiple metrics.

Source

pub const fn parameters(self, count: u64) -> Self

Set parameter count.

Source

pub fn dataset(self, dataset: impl Into<String>) -> Self

Set dataset.

Source

pub fn author(self, author: impl Into<String>) -> Self

Set author.

Source

pub fn tag(self, tag: impl Into<String>) -> Self

Add a tag.

Source

pub fn tags(self, tags: impl IntoIterator<Item = impl Into<String>>) -> Self

Add multiple tags.

Source

pub fn metadata_entry( self, key: impl Into<String>, value: impl Into<String>, ) -> Self

Add custom metadata.

Source

pub fn width(self, width: f32) -> Self

Set width.

Source

pub fn height(self, height: f32) -> Self

Set height.

Source

pub const fn background(self, color: Color) -> Self

Set background color.

Source

pub const fn border_color(self, color: Color) -> Self

Set border color.

Source

pub fn corner_radius(self, radius: f32) -> Self

Set corner radius.

Source

pub const fn show_metrics_chart(self, show: bool) -> Self

Set whether to show metrics chart.

Source

pub fn accessible_name(self, name: impl Into<String>) -> Self

Set accessible name.

Source

pub fn test_id(self, id: impl Into<String>) -> Self

Set test ID.

Source

pub fn get_name(&self) -> &str

Get model name.

Source

pub fn get_version(&self) -> &str

Get version.

Source

pub fn get_description(&self) -> Option<&str>

Get description.

Source

pub const fn get_status(&self) -> ModelStatus

Get status.

Source

pub fn get_framework(&self) -> Option<&str>

Get framework.

Source

pub fn get_task(&self) -> Option<&str>

Get task.

Source

pub fn get_metrics(&self) -> &[ModelMetric]

Get metrics.

Source

pub const fn get_parameters(&self) -> Option<u64>

Get parameter count.

Source

pub fn get_dataset(&self) -> Option<&str>

Get dataset.

Source

pub fn get_author(&self) -> Option<&str>

Get author.

Source

pub fn get_tags(&self) -> &[String]

Get tags.

Source

pub fn get_metadata(&self, key: &str) -> Option<&str>

Get custom metadata.

Source

pub fn has_metrics(&self) -> bool

Check if model has metrics.

Source

pub fn formatted_parameters(&self) -> Option<String>

Format parameter count for display.

Trait Implementations§

Source§

impl Clone for ModelCard

Source§

fn clone(&self) -> ModelCard

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelCard

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ModelCard

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ModelCard

Source§

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 Serialize for ModelCard

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Widget for ModelCard

Source§

fn type_id(&self) -> TypeId

Get the type identifier for this widget type.
Source§

fn measure(&self, constraints: Constraints) -> Size

Compute intrinsic size constraints. Read more
Source§

fn layout(&mut self, bounds: Rect) -> LayoutResult

Position children within allocated bounds. Read more
Source§

fn paint(&self, canvas: &mut dyn Canvas)

Generate draw commands for rendering. Read more
Source§

fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>

Handle input events. Read more
Source§

fn children(&self) -> &[Box<dyn Widget>]

Get child widgets for tree traversal.
Source§

fn children_mut(&mut self) -> &mut [Box<dyn Widget>]

Get mutable child widgets.
Source§

fn is_interactive(&self) -> bool

Check if this widget is interactive (can receive focus/events).
Source§

fn is_focusable(&self) -> bool

Check if this widget can receive keyboard focus.
Source§

fn accessible_name(&self) -> Option<&str>

Get the accessible name for screen readers.
Source§

fn accessible_role(&self) -> AccessibleRole

Get the accessible role.
Source§

fn test_id(&self) -> Option<&str>

Get the test ID for this widget (if any).
Source§

fn bounds(&self) -> Rect

Get the current bounds of this widget. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,