[−][src]Struct display_link::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]
F: 'static + FnMut(TimePoint) + Send,
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
Auto Trait Implementations
impl !Send for DisplayLink
impl Unpin for DisplayLink
impl !Sync for DisplayLink
impl !RefUnwindSafe for DisplayLink
impl !UnwindSafe for DisplayLink
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,