pub struct GoIdentifier(/* private fields */);Expand description
Validated ASCII-safe Go identifier.
Implementations§
Source§impl GoIdentifier
impl GoIdentifier
Sourcepub fn new(value: impl Into<String>) -> Result<Self, GoIdentifierError>
pub fn new(value: impl Into<String>) -> Result<Self, GoIdentifierError>
Creates an ASCII-safe Go identifier.
§Errors
Returns GoIdentifierError when value is empty or not ASCII identifier-shaped.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the identifier and returns the owned text.
Sourcepub fn is_exported(&self) -> bool
pub fn is_exported(&self) -> bool
Returns whether this identifier is exported by ASCII convention.
Sourcepub fn is_unexported(&self) -> bool
pub fn is_unexported(&self) -> bool
Returns whether this identifier is unexported by ASCII convention.
Trait Implementations§
Source§impl AsRef<str> for GoIdentifier
impl AsRef<str> for GoIdentifier
Source§impl Clone for GoIdentifier
impl Clone for GoIdentifier
Source§fn clone(&self) -> GoIdentifier
fn clone(&self) -> GoIdentifier
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 GoIdentifier
impl Debug for GoIdentifier
Source§impl Display for GoIdentifier
impl Display for GoIdentifier
Source§impl FromStr for GoIdentifier
impl FromStr for GoIdentifier
Source§impl Hash for GoIdentifier
impl Hash for GoIdentifier
Source§impl Ord for GoIdentifier
impl Ord for GoIdentifier
Source§fn cmp(&self, other: &GoIdentifier) -> Ordering
fn cmp(&self, other: &GoIdentifier) -> 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 GoIdentifier
impl PartialEq for GoIdentifier
Source§fn eq(&self, other: &GoIdentifier) -> bool
fn eq(&self, other: &GoIdentifier) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GoIdentifier
impl PartialOrd for GoIdentifier
Source§impl TryFrom<&str> for GoIdentifier
impl TryFrom<&str> for GoIdentifier
impl Eq for GoIdentifier
impl StructuralPartialEq for GoIdentifier
Auto Trait Implementations§
impl Freeze for GoIdentifier
impl RefUnwindSafe for GoIdentifier
impl Send for GoIdentifier
impl Sync for GoIdentifier
impl Unpin for GoIdentifier
impl UnsafeUnpin for GoIdentifier
impl UnwindSafe for GoIdentifier
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