pub struct ComponentState {
pub id: String,
pub version: Version,
pub last_rendered_version: Version,
pub checksum: Option<Checksum>,
pub area: Rect,
pub dirty: bool,
pub last_update: Instant,
pub dependencies: HashSet<String>,
}Expand description
Component state for tracking changes
Fields§
§id: StringComponent identifier
version: VersionCurrent version
last_rendered_version: VersionLast rendered version
checksum: Option<Checksum>Content checksum
area: RectArea occupied by this component
dirty: boolWhether this component should be re-rendered
last_update: InstantLast update timestamp
dependencies: HashSet<String>Dependencies (other component IDs this depends on)
Implementations§
Source§impl ComponentState
impl ComponentState
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark this component as dirty
Sourcepub fn mark_clean(&mut self)
pub fn mark_clean(&mut self)
Mark this component as clean (just rendered)
Sourcepub fn needs_render(&self) -> bool
pub fn needs_render(&self) -> bool
Check if this component needs re-rendering
Sourcepub fn update_area(&mut self, area: Rect)
pub fn update_area(&mut self, area: Rect)
Update the area occupied by this component
Sourcepub fn update_checksum(&mut self, checksum: Checksum)
pub fn update_checksum(&mut self, checksum: Checksum)
Update the checksum
Sourcepub fn add_dependency(&mut self, dependency_id: String)
pub fn add_dependency(&mut self, dependency_id: String)
Add a dependency
Sourcepub fn remove_dependency(&mut self, dependency_id: &str)
pub fn remove_dependency(&mut self, dependency_id: &str)
Remove a dependency
Trait Implementations§
Source§impl Clone for ComponentState
impl Clone for ComponentState
Source§fn clone(&self) -> ComponentState
fn clone(&self) -> ComponentState
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 moreAuto Trait Implementations§
impl Freeze for ComponentState
impl RefUnwindSafe for ComponentState
impl Send for ComponentState
impl Sync for ComponentState
impl Unpin for ComponentState
impl UnsafeUnpin for ComponentState
impl UnwindSafe for ComponentState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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