pub enum Value<J: Json, T: Id = IriBuf> {
Literal(Literal<J>, Option<T>),
LangString(LangString<J>),
Json(J),
}
Expand description
Value object.
Either a typed literal value, or an internationalized language string.
Variants
Literal(Literal<J>, Option<T>)
Typed literal value.
LangString(LangString<J>)
Tuple Fields
0: LangString<J>
Language tagged string.
Json(J)
JSON literal value.
Implementations
Return the type of the value if any.
This will return Some(Type::Json)
for JSON literal values.
If the value is a language tagged string, return its associated language if any.
Returns None
if the value is not a language tagged string.
Trait Implementations
Converts this value into a K
JSON value using the given
meta
function to convert J::MetaData
into K::MetaData
. Read more
Auto Trait Implementations
impl<J, T> RefUnwindSafe for Value<J, T> where
J: RefUnwindSafe,
T: RefUnwindSafe,
<J as Json>::Number: RefUnwindSafe,
<J as Json>::String: RefUnwindSafe,
impl<J, T> Send for Value<J, T> where
J: Send,
T: Send,
<J as Json>::Number: Send,
<J as Json>::String: Send,
impl<J, T> Sync for Value<J, T> where
J: Sync,
T: Sync,
<J as Json>::Number: Sync,
<J as Json>::String: Sync,
impl<J, T> Unpin for Value<J, T> where
J: Unpin,
T: Unpin,
<J as Json>::Number: Unpin,
<J as Json>::String: Unpin,
impl<J, T> UnwindSafe for Value<J, T> where
J: UnwindSafe,
T: UnwindSafe,
<J as Json>::Number: UnwindSafe,
<J as Json>::String: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn compact_indexed<'a, K, C, L, M>(
&'a Self,
Option<&'a str>,
Inversible<T, &'a C>,
Inversible<T, &'a C>,
Option<&'a str>,
&'a mut L,
Options,
M
) -> Pin<Box<dyn Future<Output = Result<K, Error>> + Send + 'a, Global>> where
K: JsonFrom<J>,
C: ContextMut<T> + Sync + Send,
L: Loader + Sync + Send,
J: 'a,
T: 'a,
M: 'a + Send + Sync + Clone + Fn(Option<&<J as Json>::MetaData>) -> <K as Json>::MetaData,
<C as Context<T>>::LocalContext: Send,
<C as Context<T>>::LocalContext: Sync,
<C as Context<T>>::LocalContext: From<<L as Loader>::Output>,
pub fn compact_indexed<'a, K, C, L, M>(
&'a Self,
Option<&'a str>,
Inversible<T, &'a C>,
Inversible<T, &'a C>,
Option<&'a str>,
&'a mut L,
Options,
M
) -> Pin<Box<dyn Future<Output = Result<K, Error>> + Send + 'a, Global>> where
K: JsonFrom<J>,
C: ContextMut<T> + Sync + Send,
L: Loader + Sync + Send,
J: 'a,
T: 'a,
M: 'a + Send + Sync + Clone + Fn(Option<&<J as Json>::MetaData>) -> <K as Json>::MetaData,
<C as Context<T>>::LocalContext: Send,
<C as Context<T>>::LocalContext: Sync,
<C as Context<T>>::LocalContext: From<<L as Loader>::Output>,
Compact with the given optional index.