pub struct Resolvers { /* private fields */ }Expand description
One Resolver per distinct schema in a file, built once by
FileView::resolvers.
The point is the arithmetic: a 10,000-record file written under one schema needs one resolution, not 10,000. Resolution walks both schemas and compiles an access plan, so doing it per record turns an O(1) cost into an O(n) one for no benefit.
Implementations§
Source§impl Resolvers
impl Resolvers
Sourcepub fn get(&self, schema_id: u128) -> Option<&Resolver>
pub fn get(&self, schema_id: u128) -> Option<&Resolver>
The resolver for a writer schema id, if this reader can interpret it.
Sourcepub fn for_record<'a>(&self, view: &FileView<'a>, i: usize) -> Result<&Resolver>
pub fn for_record<'a>(&self, view: &FileView<'a>, i: usize) -> Result<&Resolver>
The resolver for record i of view.
Errors with Error::Incompatible when the record’s schema cannot be
read into this reader — the mixed-file case, where skipping is often the
right response.
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resolvers
impl RefUnwindSafe for Resolvers
impl Send for Resolvers
impl Sync for Resolvers
impl Unpin for Resolvers
impl UnsafeUnpin for Resolvers
impl UnwindSafe for Resolvers
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