pub struct GameProfileString<const MAX_UTF16_CODE_UNITS: usize>(/* private fields */);Expand description
A protocol string with a game-profile-specific UTF-16 length limit.
Use the aliases GameProfileUsername, GameProfilePropertyName,
GameProfilePropertyValue, and GameProfilePropertySignature rather
than spelling the const generic directly.
Implementations§
Source§impl<const MAX_UTF16_CODE_UNITS: usize> GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> GameProfileString<MAX_UTF16_CODE_UNITS>
Sourcepub const MAX_UTF16_CODE_UNITS: usize = MAX_UTF16_CODE_UNITS
pub const MAX_UTF16_CODE_UNITS: usize = MAX_UTF16_CODE_UNITS
Maximum number of UTF-16 code units accepted by this string type.
Sourcepub fn new(value: impl Into<String>) -> Result<Self, GameProfileStringTooLong>
pub fn new(value: impl Into<String>) -> Result<Self, GameProfileStringTooLong>
Creates a string after checking its UTF-16 code-unit limit.
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Extracts the owned string.
Trait Implementations§
Source§impl<const MAX_UTF16_CODE_UNITS: usize> AsRef<str> for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> AsRef<str> for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§impl<const MAX_UTF16_CODE_UNITS: usize> Clone for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Clone for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§fn clone(&self) -> GameProfileString<MAX_UTF16_CODE_UNITS>
fn clone(&self) -> GameProfileString<MAX_UTF16_CODE_UNITS>
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<const MAX_UTF16_CODE_UNITS: usize> Debug for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Debug for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§impl<const MAX_UTF16_CODE_UNITS: usize> Default for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Default for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§fn default() -> GameProfileString<MAX_UTF16_CODE_UNITS>
fn default() -> GameProfileString<MAX_UTF16_CODE_UNITS>
Returns the “default value” for a type. Read more
Source§impl<const MAX_UTF16_CODE_UNITS: usize> Display for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Display for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Eq for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§impl<const MAX_UTF16_CODE_UNITS: usize> From<GameProfileString<MAX_UTF16_CODE_UNITS>> for String
impl<const MAX_UTF16_CODE_UNITS: usize> From<GameProfileString<MAX_UTF16_CODE_UNITS>> for String
Source§fn from(value: GameProfileString<MAX_UTF16_CODE_UNITS>) -> Self
fn from(value: GameProfileString<MAX_UTF16_CODE_UNITS>) -> Self
Converts to this type from the input type.
Source§impl<const MAX_UTF16_CODE_UNITS: usize> Hash for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Hash for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§impl<const MAX_UTF16_CODE_UNITS: usize> PartialEq for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> PartialEq for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> StructuralPartialEq for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§impl<const MAX_UTF16_CODE_UNITS: usize> TryFrom<&str> for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> TryFrom<&str> for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§impl<const MAX_UTF16_CODE_UNITS: usize> TryFrom<String> for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> TryFrom<String> for GameProfileString<MAX_UTF16_CODE_UNITS>
Source§impl<const MAX_UTF16_CODE_UNITS: usize> TypeCodec for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> TypeCodec for GameProfileString<MAX_UTF16_CODE_UNITS>
Auto Trait Implementations§
impl<const MAX_UTF16_CODE_UNITS: usize> Freeze for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> RefUnwindSafe for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Send for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Sync for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> Unpin for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> UnsafeUnpin for GameProfileString<MAX_UTF16_CODE_UNITS>
impl<const MAX_UTF16_CODE_UNITS: usize> UnwindSafe for GameProfileString<MAX_UTF16_CODE_UNITS>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ContextualCodec for Twhere
T: TypeCodec,
impl<T> ContextualCodec for Twhere
T: TypeCodec,
Source§fn encode_with_context(
&self,
writer: &mut impl Write,
_context: &Context,
) -> Result<(), CodecError>
fn encode_with_context( &self, writer: &mut impl Write, _context: &Context, ) -> Result<(), CodecError>
Encodes this value using context supplied by its enclosing structure.
Source§fn decode_with_context(
reader: &mut impl Read,
_context: &Context,
) -> Result<T, CodecError>where
T: Sized,
fn decode_with_context(
reader: &mut impl Read,
_context: &Context,
) -> Result<T, CodecError>where
T: Sized,
Decodes this value using context supplied by its enclosing structure.