pub enum ImageInput {
Url(Url),
FileToken(Uuid),
Path(PathBuf),
}Expand description
A reference to an image, accepted by all image-consuming variants.
Variants§
Url(Url)
A publicly fetchable URL.
FileToken(Uuid)
A token returned by a prior upload.
Path(PathBuf)
A local file path — must be uploaded before the request is sent.
Implementations§
Source§impl ImageInput
impl ImageInput
Sourcepub fn parse(s: &str) -> Self
pub fn parse(s: &str) -> Self
Classify a string into a variant.
http:// / https:// → ImageInput::Url. A canonical UUID → ImageInput::FileToken.
Anything else → ImageInput::Path.
Trait Implementations§
Source§impl Clone for ImageInput
impl Clone for ImageInput
Source§fn clone(&self) -> ImageInput
fn clone(&self) -> ImageInput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageInput
impl Debug for ImageInput
Source§impl<'de> Deserialize<'de> for ImageInput
impl<'de> Deserialize<'de> for ImageInput
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ImageInput
Source§impl JsonSchema for ImageInput
impl JsonSchema for ImageInput
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 moreSource§impl PartialEq for ImageInput
impl PartialEq for ImageInput
Source§fn eq(&self, other: &ImageInput) -> bool
fn eq(&self, other: &ImageInput) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ImageInput
impl Serialize for ImageInput
impl StructuralPartialEq for ImageInput
Auto Trait Implementations§
impl Freeze for ImageInput
impl RefUnwindSafe for ImageInput
impl Send for ImageInput
impl Sync for ImageInput
impl Unpin for ImageInput
impl UnsafeUnpin for ImageInput
impl UnwindSafe for ImageInput
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.