pub struct BEDConfig {
pub batch_size: usize,
pub file_schema: SchemaRef,
pub object_store: Arc<dyn ObjectStore>,
pub projection: Option<Vec<usize>>,
pub n_fields: Option<usize>,
}Expand description
Configuration for a BED datasource.
Fields§
§batch_size: usizeThe number of records to read at a time.
file_schema: SchemaRefThe schema of the BED file.
object_store: Arc<dyn ObjectStore>The object store to use.
projection: Option<Vec<usize>>Any projections to apply to the resulting batches.
n_fields: Option<usize>The number of fields of the BED to read.
Implementations§
Source§impl BEDConfig
impl BEDConfig
Sourcepub fn new(object_store: Arc<dyn ObjectStore>, file_schema: SchemaRef) -> Self
pub fn new(object_store: Arc<dyn ObjectStore>, file_schema: SchemaRef) -> Self
Create a new BED configuration.
Sourcepub fn with_n_fields(self, n_fields: usize) -> Self
pub fn with_n_fields(self, n_fields: usize) -> Self
Set the number of fields.
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set the batch size.
Sourcepub fn with_projection(self, projection: Vec<usize>) -> Self
pub fn with_projection(self, projection: Vec<usize>) -> Self
Set the projection.
Sourcepub fn with_some_projection(self, projection: Option<Vec<usize>>) -> Self
pub fn with_some_projection(self, projection: Option<Vec<usize>>) -> Self
Set the projection from an optional vector.
Sourcepub fn projected_schema(&self) -> ExonBEDResult<SchemaRef>
pub fn projected_schema(&self) -> ExonBEDResult<SchemaRef>
Get the projected schema.
Sourcepub fn projection(&self) -> Vec<usize>
pub fn projection(&self) -> Vec<usize>
Return the projection, while accounting for the number of fields.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BEDConfig
impl !RefUnwindSafe for BEDConfig
impl Send for BEDConfig
impl Sync for BEDConfig
impl Unpin for BEDConfig
impl !UnwindSafe for BEDConfig
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more