Struct GoIdentifier
pub struct GoIdentifier(/* private fields */);Expand description
Validated ASCII-safe Go identifier.
Implementations§
§impl GoIdentifier
impl GoIdentifier
pub fn new(value: impl Into<String>) -> Result<GoIdentifier, GoIdentifierError>
pub fn new(value: impl Into<String>) -> Result<GoIdentifier, GoIdentifierError>
Creates an ASCII-safe Go identifier.
§Errors
Returns GoIdentifierError when value is empty or not ASCII identifier-shaped.
pub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the identifier and returns the owned text.
pub fn is_exported(&self) -> bool
pub fn is_exported(&self) -> bool
Returns whether this identifier is exported by ASCII convention.
pub fn is_unexported(&self) -> bool
pub fn is_unexported(&self) -> bool
Returns whether this identifier is unexported by ASCII convention.
Trait Implementations§
§impl AsRef<str> for GoIdentifier
impl AsRef<str> for GoIdentifier
§impl Clone for GoIdentifier
impl Clone for GoIdentifier
§fn clone(&self) -> GoIdentifier
fn clone(&self) -> GoIdentifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for GoIdentifier
impl Debug for GoIdentifier
§impl Display for GoIdentifier
impl Display for GoIdentifier
§impl FromStr for GoIdentifier
impl FromStr for GoIdentifier
§type Err = GoIdentifierError
type Err = GoIdentifierError
The associated error which can be returned from parsing.
§fn from_str(value: &str) -> Result<GoIdentifier, <GoIdentifier as FromStr>::Err>
fn from_str(value: &str) -> Result<GoIdentifier, <GoIdentifier as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for GoIdentifier
impl Hash for GoIdentifier
§impl Ord for GoIdentifier
impl Ord for GoIdentifier
§impl PartialEq for GoIdentifier
impl PartialEq for GoIdentifier
§impl PartialOrd for GoIdentifier
impl PartialOrd for GoIdentifier
§impl TryFrom<&str> for GoIdentifier
impl TryFrom<&str> for GoIdentifier
§type Error = GoIdentifierError
type Error = GoIdentifierError
The type returned in the event of a conversion error.
§fn try_from(
value: &str,
) -> Result<GoIdentifier, <GoIdentifier as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<GoIdentifier, <GoIdentifier as TryFrom<&str>>::Error>
Performs the conversion.
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