pub struct AvroObjectReader {
store: Arc<dyn ObjectStore>,
path: Path,
runtime: Option<Handle>,
}Expand description
An implementation of an AsyncFileReader using the [ObjectStore] API.
Fields§
§store: Arc<dyn ObjectStore>§path: Path§runtime: Option<Handle>Implementations§
Source§impl AvroObjectReader
impl AvroObjectReader
Sourcepub fn new(store: Arc<dyn ObjectStore>, path: Path) -> Self
pub fn new(store: Arc<dyn ObjectStore>, path: Path) -> Self
Creates a new Self from a store implementation and file location.
Sourcepub fn with_runtime(self, handle: Handle) -> Self
pub fn with_runtime(self, handle: Handle) -> Self
Perform IO on the provided tokio runtime
Tokio is a cooperative scheduler, and relies on tasks yielding in a timely manner to service IO. Therefore, running IO and CPU-bound tasks, such as avro decoding, on the same tokio runtime can lead to degraded throughput, dropped connections and other issues. For more information see here.
fn spawn<F, O, E>(&self, f: F) -> BoxFuture<'_, Result<O, AvroError>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AvroObjectReader
impl !RefUnwindSafe for AvroObjectReader
impl Send for AvroObjectReader
impl Sync for AvroObjectReader
impl Unpin for AvroObjectReader
impl !UnwindSafe for AvroObjectReader
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