Skip to main content

MacDesignTokens

Struct MacDesignTokens 

Source
pub struct MacDesignTokens {
    pub name: String,
    pub version: String,
    pub description: String,
    pub macview: MacViewTokens,
}
Expand description

Root token catalog deserialized from tokens/design_tokens.json.

Fields§

§name: String

Token catalog schema name.

§version: String

Token catalog schema version string.

§description: String

Catalog description.

§macview: MacViewTokens

Root namespace holding all token subcategories.

Implementations§

Source§

impl MacDesignTokens

Source

pub fn load_default() -> Self

Loads default design tokens from embedded tokens/design_tokens.json.

Executes parsing within a dedicated stack thread (4MB) to guarantee immunity against stack overflows on platforms with restricted default main stacks.

Source

pub fn from_json(json: &str) -> Result<Self, Error>

Deserializes MacDesignTokens from a JSON string.

Source

pub fn control_metrics(&self) -> &MacControlMetrics

Accesses control metrics tokens.

Source

pub fn toolbar_metrics(&self) -> &ToolbarMetrics

Accesses toolbar metrics tokens.

Source

pub fn popover_metrics(&self) -> &PopoverMetrics

Accesses popover and panel metrics tokens.

Source

pub fn split_view_metrics(&self) -> &SplitViewMetrics

Accesses split view metrics tokens.

Source

pub fn layout_metrics(&self) -> &LayoutMetrics

Accesses layout container metrics tokens.

Source

pub fn scroll_view_metrics(&self) -> &ScrollViewMetrics

Accesses scroll view metrics tokens.

Source

pub fn stack_view_metrics(&self) -> &StackViewMetrics

Accesses stack view metrics tokens.

Source

pub fn outline_view_metrics(&self) -> &OutlineViewMetrics

Accesses outline view metrics tokens.

Source

pub fn slider_metrics(&self) -> &SliderMetrics

Accesses slider metrics tokens.

Source

pub fn thumbnail_metrics(&self) -> &ThumbnailCellMetrics

Accesses thumbnail metrics tokens.

Source

pub fn popup_button_metrics(&self) -> &PopUpButtonMetrics

Accesses popup button metrics tokens.

Source

pub fn search_field_metrics(&self) -> &SearchFieldMetrics

Accesses search field metrics tokens.

Source

pub fn stepper_metrics(&self) -> &StepperMetrics

Accesses stepper metrics tokens.

Source

pub fn color_well_metrics(&self) -> &ColorWellMetrics

Accesses color well metrics tokens.

Source

pub fn toggle_metrics(&self) -> &ToggleMetrics

Accesses toggle switch metrics tokens.

Source

pub fn navigation_metrics(&self) -> &NavigationMetrics

Accesses navigation and feedback metrics tokens.

Source

pub fn menu_bar_metrics(&self) -> &MenuBarMetrics

Accesses menu bar metrics tokens.

Source

pub fn footer_metrics(&self) -> &FooterMetrics

Accesses canvas footer metrics tokens.

Source

pub fn palette_metrics(&self) -> &PaletteMetrics

Accesses command palette metrics tokens.

Source

pub fn context_menu_metrics(&self) -> &ContextMenuMetrics

Accesses context menu metrics tokens.

Source

pub fn toast_metrics(&self) -> &ToastMetrics

Accesses toast notification metrics tokens.

Source

pub fn progress_indicator_metrics(&self) -> &ProgressIndicatorMetrics

Accesses progress indicator metrics tokens.

Source

pub fn table_view_metrics(&self) -> &TableViewMetrics

Accesses table view metrics tokens.

Source

pub fn token_field_metrics(&self) -> &TokenFieldMetrics

Accesses token field metrics tokens.

Source

pub fn level_indicator_metrics(&self) -> &LevelIndicatorMetrics

Accesses level indicator metrics tokens.

Source

pub fn trim_scrubber_metrics(&self) -> &TrimScrubberMetrics

Accesses trim scrubber metrics tokens.

Source

pub fn path_control_metrics(&self) -> &PathControlMetrics

Accesses path control metrics tokens.

Source

pub fn colors(&self) -> &MacColorTokens

Accesses semantic color tokens.

Source

pub fn typography(&self) -> &MacTypographyTokens

Accesses typography and optical tracking tokens.

Source

pub fn motion(&self) -> &MacMotionTokens

Accesses CoreAnimation motion preset tokens.

Trait Implementations§

Source§

impl Clone for MacDesignTokens

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MacDesignTokens

Source§

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

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

impl<'de> Deserialize<'de> for MacDesignTokens

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 PartialEq for MacDesignTokens

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MacDesignTokens

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 StructuralPartialEq for MacDesignTokens

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.