pub struct Core {
pub tree: Tree,
pub caches: WidgetCaches,
pub active_subscriptions: HashMap<String, String>,
pub default_text_size: Option<f32>,
pub default_font: Option<Font>,
pub cached_theme: Option<Theme>,
/* private fields */
}Expand description
Pure state core, decoupled from the iced runtime.
Owns the retained UI tree, widget caches, active subscriptions, and
global rendering defaults. The host calls apply with
each incoming message and executes the returned CoreEffects.
Fields§
§tree: TreeThe retained UI tree (snapshots replace it, patches update it).
caches: WidgetCachesCaches for stateful widgets (text_editor content, markdown items, etc.).
active_subscriptions: HashMap<String, String>Active event subscriptions: kind -> tag.
default_text_size: Option<f32>Global default text size from Settings.
default_font: Option<Font>Global default font from Settings.
cached_theme: Option<Theme>Cached resolved theme from the root node’s theme prop.
Only re-resolved when the raw JSON value changes.
Implementations§
Source§impl Core
impl Core
pub fn new() -> Self
Sourcepub fn tree_hash(&self) -> String
pub fn tree_hash(&self) -> String
Compute a SHA-256 hash of the current tree (serialized as JSON). Returns the hex-encoded hash string, or an empty string if no tree.
Sourcepub fn apply(&mut self, message: IncomingMessage) -> Vec<CoreEffect>
pub fn apply(&mut self, message: IncomingMessage) -> Vec<CoreEffect>
Process an incoming message, mutate state, return effects.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Core
impl !RefUnwindSafe for Core
impl Send for Core
impl !Sync for Core
impl Unpin for Core
impl UnsafeUnpin for Core
impl !UnwindSafe for Core
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().