pub struct ResRef { /* private fields */ }Expand description
Canonicalized resource reference.
KotOR resource references are case-insensitive identifiers with a maximum
length of 16 characters. This type stores the lowercase canonical form as
an inline fixed-size buffer, making it Copy and zero-allocation.
The valid character set is ASCII alphanumerics, underscore, and hyphen
([A-Za-z0-9_-]). Hyphens appear in stock KotOR content (for example
t3-m4, hk-47), so they are accepted by validation.
Implementations§
Source§impl ResRef
impl ResRef
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, ResRefError>
pub fn new(value: impl AsRef<str>) -> Result<Self, ResRefError>
Creates and validates a new resource reference.
Accepted characters are ASCII alphanumerics, underscore, and hyphen. The input is canonicalized to lowercase. An empty string produces a blank ResRef.
Trait Implementations§
Source§impl Ord for ResRef
impl Ord for ResRef
Source§impl PartialOrd for ResRef
impl PartialOrd for ResRef
impl Copy for ResRef
impl Eq for ResRef
impl StructuralPartialEq for ResRef
Auto Trait Implementations§
impl Freeze for ResRef
impl RefUnwindSafe for ResRef
impl Send for ResRef
impl Sync for ResRef
impl Unpin for ResRef
impl UnwindSafe for ResRef
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