pub enum BorderRadius {
Uniform(LengthPercentage),
Corners {
top_left: LengthPercentage,
top_right: LengthPercentage,
bottom_right: LengthPercentage,
bottom_left: LengthPercentage,
},
}Expand description
Border-radius: uniform or per-corner.
Constat #1: every other composite in this file is kebab-case on the wire
(box-shadow -> offset-x/offset-y, transform-origin -> x/y,
etc. — see rules/component-field-placement.md). Corners used to be
the sole snake_case outlier (top_left/…), with no deny_unknown_fields
and every field defaulted — so the kebab form a CSS-literate author (or
LLM) naturally writes matched zero declared fields, and being an
untagged enum, serde didn’t complain: it just produced Corners with
every corner at 0px, silently. rename_all = "kebab-case" makes kebab
the canonical wire form (matching every neighbour); alias keeps the
original snake_case working for any scenario already written that way;
deny_unknown_fields turns any other spelling (a genuine typo) into a
named parse error instead of a third silent zero.
Variants§
Uniform(LengthPercentage)
Corners
Fields
top_left: LengthPercentagetop_right: LengthPercentagebottom_right: LengthPercentagebottom_left: LengthPercentageImplementations§
Source§impl BorderRadius
impl BorderRadius
Sourcepub fn absolute_px(&self) -> Option<f32>
pub fn absolute_px(&self) -> Option<f32>
The single uniform radius as an absolute pixel value, or None when
this isn’t a shape a context-free (pre-layout) resolver can safely
interpolate: per-corner radii (which corner “wins” a 2-point
interpolation is undefined), or a unit that needs a
crate::css::units::LengthContext the caller doesn’t have yet
(%/em/rem/vw/vh — see the “unités mixtes” decision in
box_builder.rs’s resolve_transition_overrides: resolved only
where both endpoints are unambiguous, refused otherwise rather than
guessed). Used by box_builder.rs (style.transition smoothing) and
validate_schema.rs (the matching diagnostic) — both must agree on
exactly which shapes are interpolable, which is why this lives here
once instead of being reimplemented on each side.
Trait Implementations§
Source§impl Clone for BorderRadius
impl Clone for BorderRadius
Source§fn clone(&self) -> BorderRadius
fn clone(&self) -> BorderRadius
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BorderRadius
impl Debug for BorderRadius
Source§impl<'de> Deserialize<'de> for BorderRadius
impl<'de> Deserialize<'de> for BorderRadius
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>,
Source§impl JsonSchema for BorderRadius
impl JsonSchema for BorderRadius
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for BorderRadius
impl PartialEq for BorderRadius
Source§impl Serialize for BorderRadius
impl Serialize for BorderRadius
impl StructuralPartialEq for BorderRadius
Auto Trait Implementations§
impl Freeze for BorderRadius
impl RefUnwindSafe for BorderRadius
impl Send for BorderRadius
impl Sync for BorderRadius
impl Unpin for BorderRadius
impl UnsafeUnpin for BorderRadius
impl UnwindSafe for BorderRadius
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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