pub enum LazyInstance<'a> {
Ready(Cow<'a, Value>),
Deferred {
bytes: &'a [u8],
tag: u32,
make: fn(&[u8], u32) -> Value,
cell: OnceLock<Cow<'static, Value>>,
},
}Expand description
The instance a validation error reports, built once and cached.
Variants§
Ready(Cow<'a, Value>)
Deferred
Built on first read. A fn pointer rather than a boxed closure: dropck cannot see through
a dyn bounded by 'a and would demand borrows outlive the error’s drop, not just its use.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for LazyInstance<'a>
impl<'a> RefUnwindSafe for LazyInstance<'a>
impl<'a> Send for LazyInstance<'a>
impl<'a> Sync for LazyInstance<'a>
impl<'a> Unpin for LazyInstance<'a>
impl<'a> UnsafeUnpin for LazyInstance<'a>
impl<'a> UnwindSafe for LazyInstance<'a>
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