pub struct Url { /* private fields */ }Expand description
(url feature) Accepts a URL, optionally restricting the scheme and requiring a host.
Implementations§
Source§impl Url
impl Url
Sourcepub fn with_meta(self, meta: Meta) -> Self
pub fn with_meta(self, meta: Meta) -> Self
Attach human-facing metadata (name, description, examples, default, output conversion).
pub fn new() -> Self
Sourcepub fn schemes(
self,
schemes: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn schemes( self, schemes: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Restrict to the given schemes, e.g. Url::new().schemes(["http", "https"]).
Sourcepub fn require_host(self) -> Self
pub fn require_host(self) -> Self
Require the URL to have a host component.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Url
impl RefUnwindSafe for Url
impl Send for Url
impl Sync for Url
impl Unpin for Url
impl UnsafeUnpin for Url
impl UnwindSafe for Url
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,
Source§impl<T> WithMeta for Twhere
T: Validator,
impl<T> WithMeta for Twhere
T: Validator,
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
The description, if any.
Source§fn examples(&self) -> &[(Value, Option<String>)]
fn examples(&self) -> &[(Value, Option<String>)]
The example values (each with an optional note).
Source§fn default_value(&self) -> Option<&Value>
fn default_value(&self) -> Option<&Value>
The default value, if any.
Source§fn with_name(self, name: impl Into<String>) -> Self
fn with_name(self, name: impl Into<String>) -> Self
Set the human-readable name (surfaced in error messages).
Source§fn with_description(self, text: impl Into<String>) -> Self
fn with_description(self, text: impl Into<String>) -> Self
Attach a human-readable description.
Source§fn with_example(self, value: impl Into<Value>) -> Self
fn with_example(self, value: impl Into<Value>) -> Self
Add an example value.
Source§fn with_example_noted(
self,
value: impl Into<Value>,
note: impl Into<String>,
) -> Self
fn with_example_noted( self, value: impl Into<Value>, note: impl Into<String>, ) -> Self
Add an example value with an explanatory note.
Source§fn with_default(self, value: impl Into<Value>) -> Self
fn with_default(self, value: impl Into<Value>) -> Self
Set the default value used as an on-error fallback (see the pipeline’s validate stage).