pub struct Torin<Key>where
Key: NodeKey,{
pub results: HashMap<Key, LayoutNode, FxBuildHasher>,
pub dirty: HashSet<Key, FxBuildHasher>,
pub root_node_candidate: RootNodeCandidate<Key>,
}
Fields§
§results: HashMap<Key, LayoutNode, FxBuildHasher>
Layout results of the registered Nodes
dirty: HashSet<Key, FxBuildHasher>
Invalid registered nodes since previous layout measurement
root_node_candidate: RootNodeCandidate<Key>
Best Root node candidate from where to start measuring
Implementations§
§impl<Key> Torin<Key>where
Key: NodeKey,
impl<Key> Torin<Key>where
Key: NodeKey,
pub fn size(&self) -> usize
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset the layout
pub fn get_dirty_nodes(&self) -> &HashSet<Key, FxBuildHasher>
pub fn get_dirty_nodes(&self) -> &HashSet<Key, FxBuildHasher>
Read the HashSet of dirty nodes
pub fn raw_remove(&mut self, node_id: Key)
pub fn raw_remove(&mut self, node_id: Key)
Remove a Node’s result and data
pub fn remove(
&mut self,
node_id: Key,
dom_adapter: &mut impl DOMAdapter<Key>,
invalidate_parent: bool,
)
pub fn remove( &mut self, node_id: Key, dom_adapter: &mut impl DOMAdapter<Key>, invalidate_parent: bool, )
Remove a Node from the layout
pub fn safe_invalidate(
&mut self,
node_id: Key,
dom_adapter: &mut impl DOMAdapter<Key>,
)
pub fn safe_invalidate( &mut self, node_id: Key, dom_adapter: &mut impl DOMAdapter<Key>, )
Safely mark as dirty a Node
pub fn invalidate(&mut self, node_id: Key)
pub fn invalidate(&mut self, node_id: Key)
Mark as dirty a Node
pub fn check_dirty_dependants( &mut self, node_id: Key, dom_adapter: &mut impl DOMAdapter<Key>, ignore: bool, )
pub fn get_root_candidate(&self) -> RootNodeCandidate<Key>
pub fn get_root_candidate(&self) -> RootNodeCandidate<Key>
Get the Root Node candidate
pub fn find_best_root(&mut self, dom_adapter: &mut impl DOMAdapter<Key>)
pub fn find_best_root(&mut self, dom_adapter: &mut impl DOMAdapter<Key>)
Find the best root Node from where to start measuring
pub fn measure(
&mut self,
suggested_root_id: Key,
root_area: Rect<f32, Measure>,
measurer: &mut Option<impl LayoutMeasurer<Key>>,
dom_adapter: &mut impl DOMAdapter<Key>,
)
pub fn measure( &mut self, suggested_root_id: Key, root_area: Rect<f32, Measure>, measurer: &mut Option<impl LayoutMeasurer<Key>>, dom_adapter: &mut impl DOMAdapter<Key>, )
Measure dirty Nodes
pub fn get(&self, node_id: Key) -> Option<&LayoutNode>
pub fn get(&self, node_id: Key) -> Option<&LayoutNode>
Get the layout_node of a Node
pub fn cache_node(&mut self, node_id: Key, layout_node: LayoutNode)
pub fn cache_node(&mut self, node_id: Key, layout_node: LayoutNode)
Cache a Node’s layout_node
Trait Implementations§
Auto Trait Implementations§
impl<Key> Freeze for Torin<Key>where
Key: Freeze,
impl<Key> !RefUnwindSafe for Torin<Key>
impl<Key> Send for Torin<Key>where
Key: Send,
impl<Key> Sync for Torin<Key>where
Key: Sync,
impl<Key> Unpin for Torin<Key>where
Key: Unpin,
impl<Key> !UnwindSafe for Torin<Key>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§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>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.