pub struct DisplayLink(/* private fields */);Expand description
DisplayLink is a timer object used to synchronize drawing with the refresh rate of the
display.
Implementations§
Source§impl DisplayLink
impl DisplayLink
Sourcepub fn new<F>(callback: F) -> Option<Self>
pub fn new<F>(callback: F) -> Option<Self>
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.
Sourcepub fn pause(&mut self) -> Result<(), PauseError>
pub fn pause(&mut self) -> Result<(), PauseError>
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.
Sourcepub fn resume(&mut self) -> Result<(), ResumeError>
pub fn resume(&mut self) -> Result<(), ResumeError>
Resumes the DisplayLink.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DisplayLink
impl !RefUnwindSafe for DisplayLink
impl !Send for DisplayLink
impl !Sync for DisplayLink
impl Unpin for DisplayLink
impl !UnwindSafe for DisplayLink
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
Mutably borrows from an owned value. Read more