struct PurposeInputReader<'a> {
control: &'a IndexWorkControl,
limits: PurposeImportLimits,
complete_paths: BTreeSet<PathBuf>,
purpose_filename: String,
complete_digests: BTreeMap<PathBuf, String>,
}Expand description
Operation-owned reader for authored purpose and publication inputs.
Fields§
§control: &'a IndexWorkControlShared cancellation and deadline boundary for the publication.
limits: PurposeImportLimitsByte and record limits for authored purpose inputs.
complete_paths: BTreeSet<PathBuf>Inputs that must be consumed completely rather than as header prefixes.
purpose_filename: StringConfigured legacy folder-purpose filename.
complete_digests: BTreeMap<PathBuf, String>Exact digests retained only for complete publication-contract inputs.
Implementations§
Source§impl<'a> PurposeInputReader<'a>
impl<'a> PurposeInputReader<'a>
Sourcefn new(
plan: &ScanRuntimePlan,
control: &'a IndexWorkControl,
limits: PurposeImportLimits,
) -> Self
fn new( plan: &ScanRuntimePlan, control: &'a IndexWorkControl, limits: PurposeImportLimits, ) -> Self
Create one reader whose cancellation and limits belong to the scan operation.
Sourcefn for_complete_paths(
control: &'a IndexWorkControl,
limits: PurposeImportLimits,
complete_paths: BTreeSet<PathBuf>,
purpose_filename: String,
) -> Self
fn for_complete_paths( control: &'a IndexWorkControl, limits: PurposeImportLimits, complete_paths: BTreeSet<PathBuf>, purpose_filename: String, ) -> Self
Create a bounded reader before a complete runtime plan is available.
Sourcefn read_text(&mut self, path: &Path) -> Result<String, CliError>
fn read_text(&mut self, path: &Path) -> Result<String, CliError>
Read one UTF-8 input, treating non-UTF-8 source headers as purpose-free.
Sourcefn read_bytes<R: Read>(
&mut self,
path: &Path,
reader: &mut R,
file_limit: u64,
require_complete: bool,
) -> Result<Vec<u8>, CliError>
fn read_bytes<R: Read>( &mut self, path: &Path, reader: &mut R, file_limit: u64, require_complete: bool, ) -> Result<Vec<u8>, CliError>
Read bytes with inter-chunk cancellation and aggregate accounting.
Sourcefn complete_digest(&self, path: &Path) -> Option<&str>
fn complete_digest(&self, path: &Path) -> Option<&str>
Return the digest of one complete input already read through this boundary.
Auto Trait Implementations§
impl<'a> Freeze for PurposeInputReader<'a>
impl<'a> RefUnwindSafe for PurposeInputReader<'a>
impl<'a> Send for PurposeInputReader<'a>
impl<'a> Sync for PurposeInputReader<'a>
impl<'a> Unpin for PurposeInputReader<'a>
impl<'a> UnwindSafe for PurposeInputReader<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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