pub trait ViewHandle: Animatable {
// Required methods
fn layout_guide(&self) -> LayoutGuide<f32>;
fn size<F>(&self, callback: F)
where F: FnOnce(Size<f32>) + Send + 'static;
fn size_with_buffer<F>(&self, buffer: &mut Self::CommandBuffer, callback: F)
where F: FnOnce(Size<f32>) + Send + 'static;
}Expand description
This trait is implemented by platform-specific View handles.
Required Methods§
Sourcefn layout_guide(&self) -> LayoutGuide<f32>
fn layout_guide(&self) -> LayoutGuide<f32>
This function should return the layout guides of this view. TODO: on what thread does this occur?
Sourcefn size<F>(&self, callback: F)
fn size<F>(&self, callback: F)
This function should call the given callback with the size of this view.
Sourcefn size_with_buffer<F>(&self, buffer: &mut Self::CommandBuffer, callback: F)
fn size_with_buffer<F>(&self, buffer: &mut Self::CommandBuffer, callback: F)
This function should call the given callback with the size of this view. Explicitly passing a command buffer ensures that the dimensions are measured in the same UI event loop iteration as the current render itself.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.