pub struct WorkspaceName(/* private fields */);Expand description
A validated workspace name.
Guaranteed not to exceed MAX_WORKSPACE_STRING_BYTES bytes (UTF-8).
The limit is enforced at construction time via WorkspaceName::new and at
Serde decode time, so a value held in this type can never produce a payload
that exceeds MAX_SAFE_PAYLOAD_SIZE.
Implementations§
Source§impl WorkspaceName
impl WorkspaceName
Sourcepub fn new(s: impl Into<String>) -> Result<Self, WorkspaceStringError>
pub fn new(s: impl Into<String>) -> Result<Self, WorkspaceStringError>
Creates a WorkspaceName, returning WorkspaceStringError if s exceeds
MAX_WORKSPACE_STRING_BYTES bytes.
§Errors
Returns WorkspaceStringError if the byte length of s exceeds
MAX_WORKSPACE_STRING_BYTES.
Trait Implementations§
Source§impl Clone for WorkspaceName
impl Clone for WorkspaceName
Source§fn clone(&self) -> WorkspaceName
fn clone(&self) -> WorkspaceName
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 Debug for WorkspaceName
impl Debug for WorkspaceName
Source§impl<'de> Deserialize<'de> for WorkspaceName
impl<'de> Deserialize<'de> for WorkspaceName
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for WorkspaceName
impl Display for WorkspaceName
Source§impl From<WorkspaceName> for String
impl From<WorkspaceName> for String
Source§fn from(n: WorkspaceName) -> String
fn from(n: WorkspaceName) -> String
Converts to this type from the input type.
Source§impl Hash for WorkspaceName
impl Hash for WorkspaceName
Source§impl Ord for WorkspaceName
impl Ord for WorkspaceName
Source§fn cmp(&self, other: &WorkspaceName) -> Ordering
fn cmp(&self, other: &WorkspaceName) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for WorkspaceName
impl PartialEq for WorkspaceName
Source§fn eq(&self, other: &WorkspaceName) -> bool
fn eq(&self, other: &WorkspaceName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for WorkspaceName
impl PartialOrd for WorkspaceName
Source§impl Serialize for WorkspaceName
impl Serialize for WorkspaceName
Source§impl TryFrom<String> for WorkspaceName
impl TryFrom<String> for WorkspaceName
impl Eq for WorkspaceName
impl StructuralPartialEq for WorkspaceName
Auto Trait Implementations§
impl Freeze for WorkspaceName
impl RefUnwindSafe for WorkspaceName
impl Send for WorkspaceName
impl Sync for WorkspaceName
impl Unpin for WorkspaceName
impl UnsafeUnpin for WorkspaceName
impl UnwindSafe for WorkspaceName
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