pub struct StreamingParser { /* private fields */ }Expand description
Streaming parser for large SBOMs
Implementations§
Source§impl StreamingParser
impl StreamingParser
Sourcepub const fn new(config: StreamingConfig) -> Self
pub const fn new(config: StreamingConfig) -> Self
Create a new streaming parser with the given configuration
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create a streaming parser with default configuration
Sourcepub fn parse_file(&self, path: &Path) -> Result<StreamingIterator, ParseError>
pub fn parse_file(&self, path: &Path) -> Result<StreamingIterator, ParseError>
Parse a file and return an iterator of events
Sourcepub fn parse_reader<R: Read + Send + 'static>(
&self,
reader: BufReader<R>,
total_bytes: Option<u64>,
) -> Result<StreamingIterator, ParseError>
pub fn parse_reader<R: Read + Send + 'static>( &self, reader: BufReader<R>, total_bytes: Option<u64>, ) -> Result<StreamingIterator, ParseError>
Parse from a reader and return an iterator of events
Sourcepub fn parse_str(&self, content: &str) -> Result<StreamingIterator, ParseError>
pub fn parse_str(&self, content: &str) -> Result<StreamingIterator, ParseError>
Parse from string content
Sourcepub fn parse_to_sbom(&self, path: &Path) -> Result<NormalizedSbom, ParseError>
pub fn parse_to_sbom(&self, path: &Path) -> Result<NormalizedSbom, ParseError>
Collect all events into a NormalizedSbom (for convenience)
Note: This loads the entire SBOM into memory, negating the streaming benefits. Use the iterator directly for large files.
Trait Implementations§
Source§impl Debug for StreamingParser
impl Debug for StreamingParser
Auto Trait Implementations§
impl Freeze for StreamingParser
impl !RefUnwindSafe for StreamingParser
impl Send for StreamingParser
impl Sync for StreamingParser
impl Unpin for StreamingParser
impl UnsafeUnpin for StreamingParser
impl !UnwindSafe for StreamingParser
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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