pub struct RecordBuilder { /* private fields */ }Expand description
A builder for WARC records from data.
Implementations§
Source§impl RecordBuilder
impl RecordBuilder
Sourcepub fn date(self, date: DateTime<Utc>) -> Self
pub fn date(self, date: DateTime<Utc>) -> Self
Set the record date header of the record under construction.
Sourcepub fn warc_id<S: Into<String>>(self, id: S) -> Self
pub fn warc_id<S: Into<String>>(self, id: S) -> Self
Set the record ID header of the record under construction.
Sourcepub fn version(self, version: String) -> Self
pub fn version(self, version: String) -> Self
Set the WARC version of the record under construction.
Sourcepub fn warc_type(self, warc_type: RecordType) -> Self
pub fn warc_type(self, warc_type: RecordType) -> Self
Set the WARC record type header field of the record under construction.
Sourcepub fn truncated_type(self, trunc_type: TruncatedType) -> Self
pub fn truncated_type(self, trunc_type: TruncatedType) -> Self
Set the truncated type header of the record under construction.
Sourcepub fn header<V: Into<Vec<u8>>>(self, key: WarcHeader, value: V) -> Self
pub fn header<V: Into<Vec<u8>>>(self, key: WarcHeader, value: V) -> Self
Create or replace an arbitrary header of the record under construction.
Sourcepub fn build_raw(self) -> (RawRecordHeader, Vec<u8>)
pub fn build_raw(self) -> (RawRecordHeader, Vec<u8>)
Build a raw record header from the data collected in this builder.
A body set in this builder will be returned raw.
Trait Implementations§
Source§impl Clone for RecordBuilder
impl Clone for RecordBuilder
Source§impl Default for RecordBuilder
impl Default for RecordBuilder
Source§fn default() -> RecordBuilder
fn default() -> RecordBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RecordBuilder
impl !RefUnwindSafe for RecordBuilder
impl Send for RecordBuilder
impl Sync for RecordBuilder
impl Unpin for RecordBuilder
impl !UnwindSafe for RecordBuilder
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