pub enum LocItem {
Field(String),
Index(usize),
}Expand description
Location item for validation error paths.
FastAPI uses tuples where items can be either strings (field names) or integers (array indices). This enum models that structure.
§Examples
use fastapi_core::error::LocItem;
// Field name
let field = LocItem::field("email");
assert_eq!(field.as_str(), Some("email"));
// Array index
let idx = LocItem::index(0);
assert_eq!(idx.as_index(), Some(0));Variants§
Implementations§
Trait Implementations§
impl Eq for LocItem
impl StructuralPartialEq for LocItem
Auto Trait Implementations§
impl Freeze for LocItem
impl RefUnwindSafe for LocItem
impl Send for LocItem
impl Sync for LocItem
impl Unpin for LocItem
impl UnwindSafe for LocItem
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).