pub enum TaskValue {
Null,
String(String),
StringArray(Vec<String>),
Array(Vec<TaskValue>),
ObjectArray(Vec<BTreeMap<String, TaskValue>>),
Object(BTreeMap<String, TaskValue>),
LabelConfidence(LabelConfidence),
LabelConfidenceList(Vec<LabelConfidence>),
U64(u64),
F64(f64),
}Expand description
Any value stored under a task name before or after format_results.
untagged matches the JSON shapes produced by the decoder (null, scalars, arrays, objects).
Variants§
Null
String(String)
StringArray(Vec<String>)
Array(Vec<TaskValue>)
JSON array with heterogeneous elements (relations rows, span lists, etc.).
ObjectArray(Vec<BTreeMap<String, TaskValue>>)
Object(BTreeMap<String, TaskValue>)
LabelConfidence(LabelConfidence)
LabelConfidenceList(Vec<LabelConfidence>)
U64(u64)
Listed before F64 so JSON integers round-trip as integers (Label Studio and similar use as_u64()).
F64(f64)
Implementations§
Source§impl TaskValue
impl TaskValue
pub fn is_nullish(&self) -> bool
pub fn object_array_is_empty(&self) -> bool
pub fn array_is_empty(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskValue
impl<'de> Deserialize<'de> for TaskValue
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
impl StructuralPartialEq for TaskValue
Auto Trait Implementations§
impl Freeze for TaskValue
impl RefUnwindSafe for TaskValue
impl Send for TaskValue
impl Sync for TaskValue
impl Unpin for TaskValue
impl UnsafeUnpin for TaskValue
impl UnwindSafe for TaskValue
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
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more