Struct egui::context::ViewportState

source ·
pub struct ViewportState {
Show 13 fields pub class: ViewportClass, pub builder: ViewportBuilder, pub viewport_ui_cb: Option<Arc<DeferredViewportUiCallback>>, pub input: InputState, pub this_frame: FrameState, pub prev_frame: FrameState, pub used: bool, repaint: ViewportRepaintInfo, pub hits: WidgetHits, pub interact_widgets: InteractionSnapshot, pub graphics: GraphicLayers, pub output: PlatformOutput, pub commands: Vec<ViewportCommand>,
}
Expand description

State stored per viewport.

Mostly for internal use. Things here may move and change without warning.

Fields§

§class: ViewportClass

The type of viewport.

This will never be ViewportClass::Embedded, since those don’t result in real viewports.

§builder: ViewportBuilder

The latest delta

§viewport_ui_cb: Option<Arc<DeferredViewportUiCallback>>

The user-code that shows the GUI, used for deferred viewports.

None for immediate viewports.

§input: InputState§this_frame: FrameState

State that is collected during a frame and then cleared.

§prev_frame: FrameState

The final FrameState from last frame.

Only read from.

§used: bool

Has this viewport been updated this frame?

§repaint: ViewportRepaintInfo

State related to repaint scheduling.

§hits: WidgetHits

Which widgets are under the pointer?

§interact_widgets: InteractionSnapshot

What widgets are being interacted with this frame?

Based on the widgets from last frame, and input in this frame.

§graphics: GraphicLayers§output: PlatformOutput§commands: Vec<ViewportCommand>

Trait Implementations§

source§

impl Default for ViewportState

source§

fn default() -> ViewportState

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.