pub struct ViewAssistantContext {
pub key: ViewKey,
pub size: Size,
pub metrics: Size,
pub presentation_time: MonotonicInstant,
pub buffer_count: Option<usize>,
pub image_id: ImageId,
pub image_index: u32,
pub mouse_cursor_position: Option<IntPoint>,
pub display_info: Option<DisplayInfo>,
/* private fields */
}Expand description
parameter struct passed to setup and update trait methods.
Fields§
§key: ViewKeyA unique key representing this view.
size: SizeThe actual number of pixels in the view.
metrics: SizeA factor representing pixel density. Use to calculate sizes for things like fonts.
presentation_time: MonotonicInstantFor render, the time the rendering will be presented. Currently not implemented correctly.
buffer_count: Option<usize>When running in frame buffer mode, the number of buffers in the buffer collection
image_id: ImageIdThe ID of the Image being rendered in a buffer in preparation for being displayed. Used to keep track of what content needs to be rendered for a particular image in double or triple buffering configurations.
image_index: u32The index of the buffer in a buffer collection that is
being used as the contents of the image specified in
image_id.
mouse_cursor_position: Option<IntPoint>Position of the mouse cursor when running directly on the display coordinator.
display_info: Option<DisplayInfo>information about the hosting display when running directly on the display coordinator.
Implementations§
Source§impl ViewAssistantContext
impl ViewAssistantContext
Sourcepub fn new_for_testing() -> Self
pub fn new_for_testing() -> Self
Returns an empty ViewAssistantContext to enable testing with mocks
Sourcepub fn queue_message(&mut self, message: Message)
pub fn queue_message(&mut self, message: Message)
Queue up a message for delivery
Sourcepub fn request_render(&self)
pub fn request_render(&self)
Request that a render occur for this view at the next appropriate time to render.
Auto Trait Implementations§
impl Freeze for ViewAssistantContext
impl !RefUnwindSafe for ViewAssistantContext
impl !Send for ViewAssistantContext
impl !Sync for ViewAssistantContext
impl Unpin for ViewAssistantContext
impl !UnwindSafe for ViewAssistantContext
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [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>
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 more