pub struct ChunkingConfigBuilder { /* private fields */ }Expand description
Builder for creating custom chunking configurations
§Example
use ipfrs_core::{ChunkingConfig, ChunkingStrategy};
let config = ChunkingConfig::builder()
.chunk_size(1024 * 1024)
.strategy(ChunkingStrategy::ContentDefined)
.max_links_per_node(256)
.build()
.unwrap();Implementations§
Source§impl ChunkingConfigBuilder
impl ChunkingConfigBuilder
Sourcepub fn chunk_size(self, size: usize) -> Self
pub fn chunk_size(self, size: usize) -> Self
Set the chunk size
Sourcepub fn strategy(self, strategy: ChunkingStrategy) -> Self
pub fn strategy(self, strategy: ChunkingStrategy) -> Self
Set the chunking strategy
Sourcepub fn max_links_per_node(self, max_links: usize) -> Self
pub fn max_links_per_node(self, max_links: usize) -> Self
Set the maximum links per DAG node
Sourcepub fn build(self) -> Result<ChunkingConfig>
pub fn build(self) -> Result<ChunkingConfig>
Build the chunking configuration
§Errors
Returns an error if the chunk size is outside valid bounds.
Trait Implementations§
Source§impl Clone for ChunkingConfigBuilder
impl Clone for ChunkingConfigBuilder
Source§fn clone(&self) -> ChunkingConfigBuilder
fn clone(&self) -> ChunkingConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChunkingConfigBuilder
impl Debug for ChunkingConfigBuilder
Source§impl Default for ChunkingConfigBuilder
impl Default for ChunkingConfigBuilder
Source§fn default() -> ChunkingConfigBuilder
fn default() -> ChunkingConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChunkingConfigBuilder
impl RefUnwindSafe for ChunkingConfigBuilder
impl Send for ChunkingConfigBuilder
impl Sync for ChunkingConfigBuilder
impl Unpin for ChunkingConfigBuilder
impl UnwindSafe for ChunkingConfigBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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