pub trait Slotted {
// Required methods
fn supported_slots(&self) -> Vec<String>;
fn render_with_slots(
&self,
props: &SlottedProps,
) -> Result<Vec<Node>, ComponentError>;
// Provided method
fn validate_slots(&self, props: &SlottedProps) -> Result<(), ComponentError> { ... }
}
Expand description
Trait for components that support slots
Required Methods§
Sourcefn supported_slots(&self) -> Vec<String>
fn supported_slots(&self) -> Vec<String>
Get the slots this component supports
Sourcefn render_with_slots(
&self,
props: &SlottedProps,
) -> Result<Vec<Node>, ComponentError>
fn render_with_slots( &self, props: &SlottedProps, ) -> Result<Vec<Node>, ComponentError>
Render with slots
Provided Methods§
Sourcefn validate_slots(&self, props: &SlottedProps) -> Result<(), ComponentError>
fn validate_slots(&self, props: &SlottedProps) -> Result<(), ComponentError>
Validate that all required slots are provided