pub struct TaskId(/* private fields */);Expand description
Stable name used to address a task resource.
Apply, get and delete operations address a task through this name.
Uid separately identifies a particular incarnation when a name is deleted and recreated.
use solti_model::TaskId;
let id = TaskId::new("subprocess-build-1").unwrap();
assert_eq!(id.as_str(), "subprocess-build-1");Implementations§
Source§impl TaskId
impl TaskId
Sourcepub fn new(s: impl AsRef<str>) -> ModelResult<Self>
pub fn new(s: impl AsRef<str>) -> ModelResult<Self>
Creates a validated identifier.
§Errors
Returns crate::ModelError::Invalid when the value violates this identifier’s format.
Sourcepub fn into_inner(self) -> Arc<str>
pub fn into_inner(self) -> Arc<str>
Returns the underlying Arc<str>.
Source§impl TaskId
impl TaskId
Sourcepub fn validate_format(&self) -> Result<(), ModelError>
pub fn validate_format(&self) -> Result<(), ModelError>
Validates the task id.
§Errors
Returns ModelError::Invalid.
§Example
use solti_model::TaskId;
assert!(TaskId::new("subprocess-build-1").is_ok());
assert!(TaskId::new("with/slash").is_err());Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskId
impl<'de> Deserialize<'de> for TaskId
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes and validates the identifier.
impl Eq for TaskId
Source§impl JsonSchema for TaskId
impl JsonSchema for TaskId
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for TaskId
impl Ord for TaskId
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 PartialOrd for TaskId
impl PartialOrd for TaskId
impl StructuralPartialEq for TaskId
Auto Trait Implementations§
impl Freeze for TaskId
impl RefUnwindSafe for TaskId
impl Send for TaskId
impl Sync for TaskId
impl Unpin for TaskId
impl UnsafeUnpin for TaskId
impl UnwindSafe for TaskId
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