Skip to main content

FrameHook

Struct FrameHook 

Source
pub struct FrameHook<'a, A: Stores> {
    pub session: &'a Session<A>,
    pub published: &'a Publication,
    pub alpha: f32,
    pub sections: &'a [Section],
    pub ui: Option<&'a Context>,
    pub size: (u32, u32),
    pub sender: &'a CommandSender<A>,
    pub capture: CaptureControl<'a>,
    /* private fields */
}
Expand description

Runs between publication and presentation.

Fields§

§session: &'a Session<A>§published: &'a Publication§alpha: f32

The alpha published was drawn at; pass it to drawn_pose for anything drawn beside the instances.

§sections: &'a [Section]§ui: Option<&'a Context>§size: (u32, u32)§sender: &'a CommandSender<A>§capture: CaptureControl<'a>

Implementations§

Source§

impl<A: Stores> FrameHook<'_, A>

Source

pub fn capture_cursor(&mut self, enabled: bool, policy: CursorPolicy)

Source

pub fn cursor_locked(&self) -> bool

Source

pub fn set_background(&mut self, rgb: [f32; 3])

Linear light; the present clear shows wherever no Background pass paints.

Source

pub fn post(&mut self, topic: &'static str, values: &[f32])

Sent to the page as one loam-post event after this frame (native hosts discard it); positions belong in normalized canvas coordinates in [0, 1].

Source

pub fn request_redraw(&mut self)

Draws this frame under Redraw::OnChange.

Auto Trait Implementations§

§

impl<'a, A> Freeze for FrameHook<'a, A>

§

impl<'a, A> !RefUnwindSafe for FrameHook<'a, A>

§

impl<'a, A> !Send for FrameHook<'a, A>

§

impl<'a, A> !Sync for FrameHook<'a, A>

§

impl<'a, A> Unpin for FrameHook<'a, A>

§

impl<'a, A> UnsafeUnpin for FrameHook<'a, A>

§

impl<'a, A> !UnwindSafe for FrameHook<'a, A>

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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>,

Source§

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>,

Source§

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more