pub struct Name { /* private fields */ }Expand description
A task name: at most NAME_CAPACITY bytes, truncated to the
configuration’s MAX_TASK_NAME_LEN exactly as C truncates it.
Implementations§
Source§impl Name
impl Name
Sourcepub fn new(name: &str, max_len: usize) -> Self
pub fn new(name: &str, max_len: usize) -> Self
Copy name, truncated the way prvInitialiseNewTask truncates:
at most max_len - 1 bytes, because the C array’s last slot is the
NUL. max_len of 0 yields an empty name, as C’s loop would.
Truncation happens on a character boundary, so the result is always valid UTF-8 — C truncates on a byte, but every name in the corpus is ASCII and a name that is not is a configuration error, not a silent mojibake.
Trait Implementations§
impl Copy for Name
impl Eq for Name
impl StructuralPartialEq for Name
Auto Trait Implementations§
impl Freeze for Name
impl RefUnwindSafe for Name
impl Send for Name
impl Sync for Name
impl Unpin for Name
impl UnsafeUnpin for Name
impl UnwindSafe for Name
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