#[non_exhaustive]pub struct NotificationContext {
pub position: Pos2,
pub zoom: f32,
pub initial_time: Instant,
pub color: Color32,
pub kind: NodeAnimation,
pub node_id: usize,
}Expand description
The context passed to NodeTemplate::notification_ui.
#[non_exhaustive] so a future field can be added here without another
breaking change to NodeTemplate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.position: Pos2The node’s screen position: already scaled by zoom and translated
to the viewport origin.
zoom: f32Multiply every size you draw by this so it scales with the map.
initial_time: InstantWhen the notification started – usually fed into a progress
computation like Instant::now().duration_since(initial_time).
color: Color32The color requested for this notification (the node’s own color, or
the current style’s alert_color if none was set).
kind: NodeAnimationWhich built-in event effect was requested (pulse, ripple, …).
Match on this to dispatch to the corresponding
Animation function instead of
reimplementing the lookup yourself.
node_id: usizeThe id of the node this notification belongs to.
Trait Implementations§
Source§impl Clone for NotificationContext
impl Clone for NotificationContext
Source§fn clone(&self) -> NotificationContext
fn clone(&self) -> NotificationContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NotificationContext
Auto Trait Implementations§
impl Freeze for NotificationContext
impl RefUnwindSafe for NotificationContext
impl Send for NotificationContext
impl Sync for NotificationContext
impl Unpin for NotificationContext
impl UnsafeUnpin for NotificationContext
impl UnwindSafe for NotificationContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 more