#[non_exhaustive]pub enum FrameCap {
Off,
Fps(u16),
}Expand description
The most frames a second the platform shows.
60 by default (FrameCap::DEFAULT): enough for a smooth picture on
most displays, and a game that does little uses little of the CPU.
Build one with FrameCap::fps, which checks the range; a cap out of
the range (MIN_FPS to MAX_FPS), set as Fps(n) in code or read
from a file, is held to it when the platform applies it
(limit).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Off
No cap: the platform shows frames as fast as vsync, the display or the machine let it, on purpose.
Fps(u16)
At most this many frames a second.
Implementations§
Trait Implementations§
impl Copy for FrameCap
Source§impl<'de> Deserialize<'de> for FrameCap
impl<'de> Deserialize<'de> for FrameCap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FrameCap
impl StructuralPartialEq for FrameCap
Auto Trait Implementations§
impl Freeze for FrameCap
impl RefUnwindSafe for FrameCap
impl Send for FrameCap
impl Sync for FrameCap
impl Unpin for FrameCap
impl UnsafeUnpin for FrameCap
impl UnwindSafe for FrameCap
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