pub struct PartialBorderFill {
pub border: Option<Border>,
pub fill: Option<Fill>,
}Expand description
Combined border and fill configuration with optional fields for YAML.
After inheritance resolution, this is converted to BorderFill where
all fields are guaranteed to be present.
§Examples
use hwpforge_blueprint::border_fill::PartialBorderFill;
let partial = PartialBorderFill::default();
let resolved = partial.resolve();
assert_eq!(resolved.border.top.line_type, hwpforge_foundation::BorderLineType::None);Fields§
§border: Option<Border>Border configuration.
fill: Option<Fill>Fill configuration.
Implementations§
Source§impl PartialBorderFill
impl PartialBorderFill
Sourcepub fn merge(&mut self, other: &PartialBorderFill)
pub fn merge(&mut self, other: &PartialBorderFill)
Merges other into self (child overrides parent).
§Examples
use hwpforge_blueprint::border_fill::{PartialBorderFill, Fill};
use hwpforge_foundation::{FillBrushType, Color};
let mut base = PartialBorderFill::default();
let child = PartialBorderFill {
fill: Some(Fill {
brush_type: FillBrushType::Solid,
color: Some(Color::WHITE),
color2: None,
}),
..Default::default()
};
base.merge(&child);
assert!(base.fill.is_some());Sourcepub fn resolve(&self) -> BorderFill
pub fn resolve(&self) -> BorderFill
Resolves into a fully-specified BorderFill with defaults.
§Examples
use hwpforge_blueprint::border_fill::PartialBorderFill;
let partial = PartialBorderFill::default();
let resolved = partial.resolve();
assert_eq!(resolved.fill.brush_type, hwpforge_foundation::FillBrushType::None);Trait Implementations§
Source§impl Clone for PartialBorderFill
impl Clone for PartialBorderFill
Source§fn clone(&self) -> PartialBorderFill
fn clone(&self) -> PartialBorderFill
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PartialBorderFill
impl Debug for PartialBorderFill
Source§impl Default for PartialBorderFill
impl Default for PartialBorderFill
Source§fn default() -> PartialBorderFill
fn default() -> PartialBorderFill
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PartialBorderFill
impl<'de> Deserialize<'de> for PartialBorderFill
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 JsonSchema for PartialBorderFill
impl JsonSchema for PartialBorderFill
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for PartialBorderFill
impl PartialEq for PartialBorderFill
Source§impl Serialize for PartialBorderFill
impl Serialize for PartialBorderFill
impl StructuralPartialEq for PartialBorderFill
Auto Trait Implementations§
impl Freeze for PartialBorderFill
impl RefUnwindSafe for PartialBorderFill
impl Send for PartialBorderFill
impl Sync for PartialBorderFill
impl Unpin for PartialBorderFill
impl UnwindSafe for PartialBorderFill
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