pub struct StyleRegistry { /* private fields */ }Expand description
Registry that tracks all scoped styles in the application. Uses &’static str to avoid runtime allocations - all CSS is embedded at compile time.
Implementations§
Source§impl StyleRegistry
impl StyleRegistry
Sourcepub fn register(&mut self, hash: &'static str, css: &'static str)
pub fn register(&mut self, hash: &'static str, css: &'static str)
Registers a scoped style with its hash.
§Arguments
hash- The unique hash/scope for this style (compile-time static)css- The scoped CSS content (compile-time static)
Sourcepub fn get_all_styles(&mut self) -> &str
pub fn get_all_styles(&mut self) -> &str
Gets all registered styles as a single CSS string. Uses cached output for repeated calls (optimization #1).
Trait Implementations§
Source§impl Debug for StyleRegistry
impl Debug for StyleRegistry
Source§impl Default for StyleRegistry
impl Default for StyleRegistry
Source§fn default() -> StyleRegistry
fn default() -> StyleRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StyleRegistry
impl RefUnwindSafe for StyleRegistry
impl Send for StyleRegistry
impl Sync for StyleRegistry
impl Unpin for StyleRegistry
impl UnwindSafe for StyleRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.