WriterBuilder

结构体 WriterBuilder 

源代码
pub struct WriterBuilder {
    schema: Schema,
    codec: Option<CompressionCodec>,
    capacity: usize,
    fingerprint_strategy: Option<FingerprintStrategy>,
}
展开描述

用于配置和创建 Writer 的构建器。

字段§

§schema: Schema§codec: Option<CompressionCodec>§capacity: usize§fingerprint_strategy: Option<FingerprintStrategy>

实现§

源文件§

impl WriterBuilder

源代码

pub fn new(schema: Schema) -> Self

创建一个具有默认设置的新构建器。

用于写入的 Avro 模式(schema)按以下方式确定

  1. 如果 Arrow 模式元数据包含 avro::schema(参见 SCHEMA_METADATA_KEY),则直接使用该 JSON。
  2. 否则,将 Arrow 模式转换为 Avro 记录模式。
源代码

pub fn with_fingerprint_strategy(self, strategy: FingerprintStrategy) -> Self

设置流写入器的指纹策略。这决定了每条记录的前缀格式。

源代码

pub fn with_compression(self, codec: Option<CompressionCodec>) -> Self

更改压缩编解码器。

源代码

pub fn with_capacity(self, capacity: usize) -> Self

设置给定对象的容量并返回修改后的实例。

源代码

pub fn build<W, F>(self, writer: W) -> Result<Writer<W, F>, ArrowError>
其中 W: Write, F: AvroFormat,

使用指定的 AvroFormat 和构建器选项创建新的 Writer。执行一次性启动(头部/流初始化、编码器计划)。

Trait 实现§

源文件§

impl Clone for WriterBuilder

源文件§

fn clone(&self) -> WriterBuilder

返回值的副本。 阅读更多
1.0.0 · §

fn clone_from(&mut self, source: &Self)

执行从 source 的复制赋值。 阅读更多
源文件§

impl Debug for WriterBuilder

源文件§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

使用给定的格式化程序格式化值。 阅读更多

自动 Trait 实现§

通用实现§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

获取 selfTypeId阅读更多
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

从拥有的值进行不可变借用。 阅读更多
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

从拥有的值进行可变借用。 阅读更多
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬这是一个仅限 nightly 的实验性 API。(clone_to_uninit
执行从 selfdest 的复制赋值。 阅读更多
§

impl<T> From<T> for T

§

fn from(t: T) -> T

返回未更改的参数。

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换是 From<T> for U 的实现选择执行的任何操作。

§

impl<T> Same for T

§

type Output = T

应该总是 Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

获取所有权后的结果类型。
§

fn to_owned(&self) -> T

从借用的数据创建拥有的数据,通常通过克隆。 阅读更多
§

fn clone_into(&self, target: &mut T)

使用借用的数据替换拥有的数据,通常通过克隆。 阅读更多
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

转换错误时返回的类型。
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

转换错误时返回的类型。
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行转换。
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,