pub enum UrlRejection {
Scheme(String),
Unresolvable(String),
PrivateAddress {
host: String,
addr: IpAddr,
},
}Expand description
Why a URL was refused. Rendered into the tool result the model sees, so it says what to do differently rather than just failing.
Variants§
Scheme(String)
The scheme is not http or https.
Unresolvable(String)
The host did not resolve to any address.
PrivateAddress
The host resolved to an address outside the public internet.
Implementations§
Source§impl UrlRejection
impl UrlRejection
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
A stable short name for this refusal.
Exists so a test can assert_eq!(err.kind(), "private_address") rather
than assert!(matches!(err, ...)) - the matches! non-matching arm is a
region only a failing assertion ever reaches, which reads as uncovered
under the workspace’s 100% gate. Useful in its own right for structured
logging, where the kind is the field worth indexing on.
Trait Implementations§
Source§impl Clone for UrlRejection
impl Clone for UrlRejection
Source§fn clone(&self) -> UrlRejection
fn clone(&self) -> UrlRejection
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 UrlRejection
impl Debug for UrlRejection
Source§impl Display for UrlRejection
impl Display for UrlRejection
impl Eq for UrlRejection
Source§impl PartialEq for UrlRejection
impl PartialEq for UrlRejection
impl StructuralPartialEq for UrlRejection
Auto Trait Implementations§
impl Freeze for UrlRejection
impl RefUnwindSafe for UrlRejection
impl Send for UrlRejection
impl Sync for UrlRejection
impl Unpin for UrlRejection
impl UnsafeUnpin for UrlRejection
impl UnwindSafe for UrlRejection
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<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.