pub enum UrlOr<T> {
Url(Url),
Object(T),
}Expand description
A value that may appear inlined as T or as a bare URL reference.
AS 2.0 object-valued properties frequently arrive either:
- embedded as a full object (
{ "id": "https://…", "type": "Note", … }) - or as just the URL string (
"https://example.com/note/1")
UrlOr captures both variants.
Variants§
Url(Url)
A bare URL reference to the remote resource.
Object(T)
An inlined object of the target type.
Implementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for UrlOr<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for UrlOr<T>where
T: Deserialize<'de>,
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<T: Eq> Eq for UrlOr<T>
impl<T: PartialEq> StructuralPartialEq for UrlOr<T>
Auto Trait Implementations§
impl<T> Freeze for UrlOr<T>where
T: Freeze,
impl<T> RefUnwindSafe for UrlOr<T>where
T: RefUnwindSafe,
impl<T> Send for UrlOr<T>where
T: Send,
impl<T> Sync for UrlOr<T>where
T: Sync,
impl<T> Unpin for UrlOr<T>where
T: Unpin,
impl<T> UnsafeUnpin for UrlOr<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for UrlOr<T>where
T: UnwindSafe,
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>,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.