pub struct ViewportOutput {
pub parent: ViewportId,
pub class: ViewportClass,
pub builder: ViewportBuilder,
pub viewport_ui_cb: Option<Arc<dyn Fn(&Context) + Sync + Send>>,
pub commands: Vec<ViewportCommand>,
pub repaint_delay: Duration,
}
Expand description
Describes a viewport, i.e. a native window.
This is returned by crate::Context::run
on each frame, and should be applied
by the integration.
Fields§
§parent: ViewportId
Id of our parent viewport.
class: ViewportClass
What type of viewport are we?
This will never be ViewportClass::Embedded
,
since those don’t result in real viewports.
builder: ViewportBuilder
The window attrbiutes such as title, position, size, etc.
Use this when first constructing the native window.
Also check for changes in it using ViewportBuilder::patch
,
and apply them as needed.
viewport_ui_cb: Option<Arc<dyn Fn(&Context) + Sync + Send>>
The user-code that shows the GUI, used for deferred viewports.
None
for immediate viewports and the ROOT viewport.
commands: Vec<ViewportCommand>
Commands to change the viewport, e.g. window title and size.
repaint_delay: Duration
Schedule a repaint of this viewport after this delay.
It is preferable to instead install a Context::set_request_repaint_callback
,
but if you haven’t, you can use this instead.
If the duration is zero, schedule a repaint immediately.
Implementations§
§impl ViewportOutput
impl ViewportOutput
pub fn append(&mut self, newer: ViewportOutput)
pub fn append(&mut self, newer: ViewportOutput)
Add on new output.
Trait Implementations§
§impl Clone for ViewportOutput
impl Clone for ViewportOutput
§fn clone(&self) -> ViewportOutput
fn clone(&self) -> ViewportOutput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for ViewportOutput
impl !RefUnwindSafe for ViewportOutput
impl Send for ViewportOutput
impl Sync for ViewportOutput
impl Unpin for ViewportOutput
impl !UnwindSafe for ViewportOutput
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§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>
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>
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)
&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)
&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> ⓘ
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request