pub struct PulseTicks(/* private fields */);Expand description
Number of ticks, restricting the range to 0 to 32,767.
Implementations§
Source§impl PulseTicks
impl PulseTicks
Sourcepub const fn new(ticks: u16) -> Result<Self, EspError>
pub const fn new(ticks: u16) -> Result<Self, EspError>
Create a PulseTicks from the given number of ticks.
§Errors
If the given number of ticks is larger than PulseTicks::max(), an error with the code
ESP_ERR_INVALID_ARG will be returned.
Sourcepub const fn new_with_duration(
resolution: Hertz,
duration: Duration,
) -> Result<Self, EspError>
pub const fn new_with_duration( resolution: Hertz, duration: Duration, ) -> Result<Self, EspError>
Constructs a PulseTicks from a [Duration].
§Errors
If the duration is too long to be represented as ticks with the given resolution,
an error with the code [ERR_EOVERFLOW] or ESP_ERR_INVALID_ARG will be returned.
Trait Implementations§
Source§impl Clone for PulseTicks
impl Clone for PulseTicks
Source§fn clone(&self) -> PulseTicks
fn clone(&self) -> PulseTicks
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PulseTicks
impl Debug for PulseTicks
Source§impl Default for PulseTicks
impl Default for PulseTicks
Source§fn default() -> PulseTicks
fn default() -> PulseTicks
Returns the “default value” for a type. Read more
Source§impl Ord for PulseTicks
impl Ord for PulseTicks
Source§impl PartialEq for PulseTicks
impl PartialEq for PulseTicks
Source§impl PartialOrd for PulseTicks
impl PartialOrd for PulseTicks
Source§fn partial_cmp(&self, other: &PulseTicks) -> Option<Ordering>
fn partial_cmp(&self, other: &PulseTicks) -> Option<Ordering>
impl Copy for PulseTicks
impl Eq for PulseTicks
impl StructuralPartialEq for PulseTicks
Auto Trait Implementations§
impl Freeze for PulseTicks
impl RefUnwindSafe for PulseTicks
impl Send for PulseTicks
impl Sync for PulseTicks
impl Unpin for PulseTicks
impl UnsafeUnpin for PulseTicks
impl UnwindSafe for PulseTicks
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)