pub enum StringLikeOr<S, T> {
StringLike(S),
Val(T),
}Expand description
A value or just a string
This allows us to have a simple string-based version of a config while still allowing for a more advanced version to exist.
Variants§
StringLike(S)
They gave the simple string-like value (see declare_strongly_typed_string!)
Val(T)
They gave a more interesting value
Implementations§
Trait Implementations§
Source§impl<S: Clone, T: Clone> Clone for StringLikeOr<S, T>
impl<S: Clone, T: Clone> Clone for StringLikeOr<S, T>
Source§fn clone(&self) -> StringLikeOr<S, T>
fn clone(&self) -> StringLikeOr<S, T>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, S, T> Deserialize<'de> for StringLikeOr<S, T>where
S: Deserialize<'de>,
T: Deserialize<'de>,
impl<'de, S, T> Deserialize<'de> for StringLikeOr<S, T>where
S: Deserialize<'de>,
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
Source§impl<S, T> JsonSchema for StringLikeOr<S, T>where
S: JsonSchema,
T: JsonSchema,
impl<S, T> JsonSchema for StringLikeOr<S, T>where
S: JsonSchema,
T: JsonSchema,
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl<S, T> Freeze for StringLikeOr<S, T>
impl<S, T> RefUnwindSafe for StringLikeOr<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for StringLikeOr<S, T>
impl<S, T> Sync for StringLikeOr<S, T>
impl<S, T> Unpin for StringLikeOr<S, T>
impl<S, T> UnwindSafe for StringLikeOr<S, T>where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)