pub struct BackgroundTaskID(/* private fields */);Expand description
Unique identifier for a background task, in the bt- form used by
Studio apps.
This is the same identity as TaskID, written the way an app sees it.
Every Studio app is launched with its own task id in the environment,
and Studio surfaces the same id in log URLs (/logs/bt-55b5) and in
cloud-batch job names. Parsing that form previously had no home in this
client, so each app hand-rolled the hex decode – int(task_id[3:], 16)
and similar – reimplementing a format the client is supposed to own and
skipping the prefix validation the client would have applied.
Convert to a TaskID to use it with Client::task_info and the
other task methods:
use edgefirst_client::{BackgroundTaskID, TaskID};
use std::str::FromStr;
let bt = BackgroundTaskID::from_str("bt-55b5").unwrap();
assert_eq!(bt.value(), 0x55b5);
// Same task, the form the RPC API expects.
let task: TaskID = bt.into();
assert_eq!(task.value(), 0x55b5);
assert_eq!(task.to_string(), "task-55b5");Implementations§
Trait Implementations§
Source§impl Clone for BackgroundTaskID
impl Clone for BackgroundTaskID
Source§fn clone(&self) -> BackgroundTaskID
fn clone(&self) -> BackgroundTaskID
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 moreimpl Copy for BackgroundTaskID
Source§impl Debug for BackgroundTaskID
impl Debug for BackgroundTaskID
Source§impl Default for BackgroundTaskID
impl Default for BackgroundTaskID
Source§fn default() -> BackgroundTaskID
fn default() -> BackgroundTaskID
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BackgroundTaskID
impl<'de> Deserialize<'de> for BackgroundTaskID
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 BackgroundTaskID
impl Display for BackgroundTaskID
impl Eq for BackgroundTaskID
Source§impl From<BackgroundTaskID> for u64
impl From<BackgroundTaskID> for u64
Source§fn from(val: BackgroundTaskID) -> Self
fn from(val: BackgroundTaskID) -> Self
Converts to this type from the input type.
Source§impl From<BackgroundTaskID> for TaskID
impl From<BackgroundTaskID> for TaskID
Source§fn from(id: BackgroundTaskID) -> Self
fn from(id: BackgroundTaskID) -> Self
Converts to this type from the input type.
Source§impl From<TaskID> for BackgroundTaskID
impl From<TaskID> for BackgroundTaskID
Source§impl From<u64> for BackgroundTaskID
impl From<u64> for BackgroundTaskID
Source§impl FromStr for BackgroundTaskID
impl FromStr for BackgroundTaskID
Source§impl Hash for BackgroundTaskID
impl Hash for BackgroundTaskID
Source§impl PartialEq for BackgroundTaskID
impl PartialEq for BackgroundTaskID
Source§impl Serialize for BackgroundTaskID
impl Serialize for BackgroundTaskID
impl StructuralPartialEq for BackgroundTaskID
Source§impl TryFrom<&str> for BackgroundTaskID
impl TryFrom<&str> for BackgroundTaskID
Auto Trait Implementations§
impl Freeze for BackgroundTaskID
impl RefUnwindSafe for BackgroundTaskID
impl Send for BackgroundTaskID
impl Sync for BackgroundTaskID
impl Unpin for BackgroundTaskID
impl UnsafeUnpin for BackgroundTaskID
impl UnwindSafe for BackgroundTaskID
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more