pub struct TaskMetadata {
pub task_id: String,
pub status_message: Option<String>,
pub created_at: String,
pub last_updated_at: String,
pub ttl_ms: Option<u64>,
pub poll_interval_ms: Option<u64>,
}Expand description
Fields shared by every final task state.
Fields§
§task_id: StringStable, server-generated task identifier.
status_message: Option<String>Optional human-readable state description.
created_at: StringISO 8601 creation timestamp.
last_updated_at: StringISO 8601 timestamp of the latest state change.
ttl_ms: Option<u64>Time-to-live from creation in milliseconds, or null for unlimited.
Unlike an omitted optional field, SEP-2663 requires ttlMs to be
present. None therefore serializes as JSON null.
poll_interval_ms: Option<u64>Suggested client polling interval in milliseconds.
Implementations§
Source§impl TaskMetadata
impl TaskMetadata
Sourcepub fn new(
task_id: impl Into<String>,
created_at: impl Into<String>,
last_updated_at: impl Into<String>,
ttl_ms: Option<u64>,
) -> TaskMetadata
pub fn new( task_id: impl Into<String>, created_at: impl Into<String>, last_updated_at: impl Into<String>, ttl_ms: Option<u64>, ) -> TaskMetadata
Construct the required final task metadata.
Sourcepub fn with_status_message(self, message: impl Into<String>) -> TaskMetadata
pub fn with_status_message(self, message: impl Into<String>) -> TaskMetadata
Set a human-readable status message.
Sourcepub fn with_poll_interval_ms(self, poll_interval_ms: u64) -> TaskMetadata
pub fn with_poll_interval_ms(self, poll_interval_ms: u64) -> TaskMetadata
Set the suggested polling interval.
Trait Implementations§
Source§impl Clone for TaskMetadata
impl Clone for TaskMetadata
Source§fn clone(&self) -> TaskMetadata
fn clone(&self) -> TaskMetadata
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 TaskMetadata
impl Debug for TaskMetadata
Source§impl<'de> Deserialize<'de> for TaskMetadata
impl<'de> Deserialize<'de> for TaskMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TaskMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TaskMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TaskMetadata
Source§impl PartialEq for TaskMetadata
impl PartialEq for TaskMetadata
Source§impl Serialize for TaskMetadata
impl Serialize for TaskMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TaskMetadata
Auto Trait Implementations§
impl Freeze for TaskMetadata
impl RefUnwindSafe for TaskMetadata
impl Send for TaskMetadata
impl Sync for TaskMetadata
impl Unpin for TaskMetadata
impl UnsafeUnpin for TaskMetadata
impl UnwindSafe for TaskMetadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.