pub fn new<T: TryInto<Self, Error = InvalidNameError>>(
        contents: T,
    ) -> Result<Self, InvalidNameError> {
        contents.try_into()
    }
/// Creates a new name after validating it.
///
/// # Errors
/// Returns [`InvalidNameError`] if the value passed contains any characters
/// other than `a-zA-Z9-0` or a hyphen (`-`).
Creates a new name after validating it.
Creates a new name after validating it .
pub fn new<T: TryInto<Self, Error = InvalidNameError>>(
        contents: T,
    ) -> Result<Self, InvalidNameError> {
        contents.try_into()
    }
pub fn new < T : TryInto < Self , Error = InvalidNameError > > ( contents : T , ) -> Result < Self , InvalidNameError > { contents . try_into ( ) }
Creates a new name after validating it.
Creates a new name after validating it .
contents
T
contents
T
errors
Returns [`InvalidNameError`] if the value passed contains any characters
other than `a-zA-Z9-0` or a hyphen (`-`).
Returns [ ` InvalidNameError ` ] if the value passed contains any characters other than ` a - zA - Z9 - 0 ` or a hyphen ( ` - ` ) .