pub enum RefOr<R, T> {
Ref(Ref<R>),
Other(T),
}Expand description
Either a reference or an inline definition.
Variants§
Trait Implementations§
Source§impl<'de, R, T> Deserialize<'de> for RefOr<R, T>where
R: DeserializeOwned,
T: DeserializeOwned,
impl<'de, R, T> Deserialize<'de> for RefOr<R, T>where
R: DeserializeOwned,
T: DeserializeOwned,
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<R, T> JsonPointee for RefOr<R, T>where
R: JsonPointee,
T: JsonPointee,
impl<R, T> JsonPointee for RefOr<R, T>where
R: JsonPointee,
T: JsonPointee,
Source§fn resolve(
&self,
pointer: &JsonPointer,
) -> Result<&dyn JsonPointee, JsonPointeeError>
fn resolve( &self, pointer: &JsonPointer, ) -> Result<&dyn JsonPointee, JsonPointeeError>
Resolves a
JsonPointer against this value.Source§impl<'pointee, R, T> JsonPointerTarget<'pointee> for &'pointee RefOr<R, T>
impl<'pointee, R, T> JsonPointerTarget<'pointee> for &'pointee RefOr<R, T>
Source§fn from_pointee(
pointee: &'pointee dyn JsonPointee,
) -> Result<Self, JsonPointerTargetError>
fn from_pointee( pointee: &'pointee dyn JsonPointee, ) -> Result<Self, JsonPointerTargetError>
Tries to extract
Self from a resolved pointee.Auto Trait Implementations§
impl<R, T> Freeze for RefOr<R, T>
impl<R, T> RefUnwindSafe for RefOr<R, T>where
T: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, T> Send for RefOr<R, T>
impl<R, T> Sync for RefOr<R, T>
impl<R, T> Unpin for RefOr<R, T>
impl<R, T> UnsafeUnpin for RefOr<R, T>where
T: UnsafeUnpin,
R: UnsafeUnpin,
impl<R, T> UnwindSafe for RefOr<R, T>where
T: UnwindSafe,
R: 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
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<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<P> JsonPointeeExt for Pwhere
P: JsonPointee + ?Sized,
impl<P> JsonPointeeExt for Pwhere
P: JsonPointee + ?Sized,
Source§fn pointer<'a, T>(&'a self, path: &str) -> Result<T, JsonPointerError>where
T: JsonPointerTarget<'a>,
fn pointer<'a, T>(&'a self, path: &str) -> Result<T, JsonPointerError>where
T: JsonPointerTarget<'a>,
Parses a JSON pointer string, resolves it against this value,
and extracts the result as
T.