pub struct ReactHookName(/* private fields */);Expand description
Validated React hook name metadata.
Implementations§
Source§impl ReactHookName
impl ReactHookName
Sourcepub fn new(input: &str) -> Result<ReactHookName, ReactNameError>
pub fn new(input: &str) -> Result<ReactHookName, ReactNameError>
Creates a lightly validated React hook name.
§Errors
Returns ReactNameError when input is not an ASCII identifier or does not start with use plus a suffix.
Sourcepub fn has_canonical_suffix(&self) -> bool
pub fn has_canonical_suffix(&self) -> bool
Returns whether the hook uses the common use + uppercase convention.
Trait Implementations§
Source§impl Clone for ReactHookName
impl Clone for ReactHookName
Source§fn clone(&self) -> ReactHookName
fn clone(&self) -> ReactHookName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReactHookName
impl Debug for ReactHookName
Source§impl Hash for ReactHookName
impl Hash for ReactHookName
Source§impl Ord for ReactHookName
impl Ord for ReactHookName
Source§fn cmp(&self, other: &ReactHookName) -> Ordering
fn cmp(&self, other: &ReactHookName) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ReactHookName
impl PartialEq for ReactHookName
Source§fn eq(&self, other: &ReactHookName) -> bool
fn eq(&self, other: &ReactHookName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ReactHookName
impl PartialOrd for ReactHookName
impl Eq for ReactHookName
impl StructuralPartialEq for ReactHookName
Auto Trait Implementations§
impl Freeze for ReactHookName
impl RefUnwindSafe for ReactHookName
impl Send for ReactHookName
impl Sync for ReactHookName
impl Unpin for ReactHookName
impl UnsafeUnpin for ReactHookName
impl UnwindSafe for ReactHookName
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