[][src]Struct display_link::DisplayLink

pub struct DisplayLink(_);

DisplayLink is a timer object used to synchronize drawing with the refresh rate of the display.

Methods

impl DisplayLink[src]

pub fn new<F>(callback: F) -> Option<Self> where
    F: 'static + FnMut(TimePoint) + Send
[src]

Creates a new DisplayLink with a callback that will be invoked with the TimePoint the screen will next refresh.

The returned DisplayLink will be in a paused state. Returns None if a DisplayLink could not be created.

Panic

If the callback panics, the process will be aborted.

pub fn is_paused(&self) -> bool[src]

Returns true if the DisplayLink is currently paused.

pub fn pause(&mut self) -> Result<(), PauseError>[src]

Pauses the DisplayLink.

A paused DisplayLink will not invoke it's callback. On iOS, it is necessary to pause the DisplayLink in response to events like backgrounding.

pub fn resume(&mut self) -> Result<(), ResumeError>[src]

Resumes the DisplayLink.

Trait Implementations

impl Debug for DisplayLink[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]