pub struct CreateOptionsBuilder { /* private fields */ }Expand description
Builder for CreateOptions.
Implementations§
Source§impl CreateOptionsBuilder
impl CreateOptionsBuilder
Sourcepub fn manifest(self, manifest: ManifestOptions) -> Self
pub fn manifest(self, manifest: ManifestOptions) -> Self
Replaces manifest scanning options.
Sourcepub const fn mode(self, mode: CreateMode) -> Self
pub const fn mode(self, mode: CreateMode) -> Self
Selects the protocol representation to create.
Sourcepub const fn piece_length(self, piece_length: PieceLength) -> Self
pub const fn piece_length(self, piece_length: PieceLength) -> Self
Selects automatic or explicit piece length.
Sourcepub const fn hash_threads(self, hash_threads: HashThreads) -> Self
pub const fn hash_threads(self, hash_threads: HashThreads) -> Self
Selects automatic or explicit v1 hashing workers.
Sourcepub fn trackers(self, trackers: impl IntoIterator<Item = Vec<Vec<u8>>>) -> Self
pub fn trackers(self, trackers: impl IntoIterator<Item = Vec<Vec<u8>>>) -> Self
Replaces tracker tiers.
Sourcepub fn web_seeds(self, web_seeds: impl IntoIterator<Item = Vec<u8>>) -> Self
pub fn web_seeds(self, web_seeds: impl IntoIterator<Item = Vec<u8>>) -> Self
Replaces web seed URLs.
Sourcepub fn nodes(self, nodes: impl IntoIterator<Item = (Vec<u8>, u16)>) -> Self
pub fn nodes(self, nodes: impl IntoIterator<Item = (Vec<u8>, u16)>) -> Self
Replaces DHT bootstrap nodes.
Sourcepub fn created_by(self, created_by: Vec<u8>) -> Self
pub fn created_by(self, created_by: Vec<u8>) -> Self
Sets the top-level creator string.
Sourcepub fn omit_created_by(self) -> Self
pub fn omit_created_by(self) -> Self
Omits the top-level creator field instead of using the versioned default.
Sourcepub const fn creation_date(self, creation_date: i64) -> Self
pub const fn creation_date(self, creation_date: i64) -> Self
Includes an explicit Unix creation timestamp.
Sourcepub fn entropy(self, entropy: Vec<u8>) -> Self
pub fn entropy(self, entropy: Vec<u8>) -> Self
Sets explicit cross-seeding entropy in the info dictionary.
Sourcepub fn build(self) -> Result<CreateOptions>
pub fn build(self) -> Result<CreateOptions>
Validates metadata and builds options.
§Errors
Returns a metainfo error for empty tracker URLs, web seeds, node hosts, or other invalid metadata inputs.
Trait Implementations§
Source§impl Clone for CreateOptionsBuilder
impl Clone for CreateOptionsBuilder
Source§fn clone(&self) -> CreateOptionsBuilder
fn clone(&self) -> CreateOptionsBuilder
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 CreateOptionsBuilder
impl Debug for CreateOptionsBuilder
Auto Trait Implementations§
impl Freeze for CreateOptionsBuilder
impl RefUnwindSafe for CreateOptionsBuilder
impl Send for CreateOptionsBuilder
impl Sync for CreateOptionsBuilder
impl Unpin for CreateOptionsBuilder
impl UnwindSafe for CreateOptionsBuilder
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