pub struct SourceTreeDescriptorDatabase<'a> { /* private fields */ }
Expand description
An implementation of DescriptorDatabase
which loads files from a
SourceTree
and parses them.
Note: This class does not implement FindFileContainingSymbol
or
FindFileContainingExtension
; these will always return false.
Implementations§
source§impl<'a> SourceTreeDescriptorDatabase<'a>
impl<'a> SourceTreeDescriptorDatabase<'a>
sourcepub fn new(
source_tree: Pin<&'a mut dyn SourceTree>,
) -> Pin<Box<SourceTreeDescriptorDatabase<'a>>>
pub fn new( source_tree: Pin<&'a mut dyn SourceTree>, ) -> Pin<Box<SourceTreeDescriptorDatabase<'a>>>
Constructs a new descriptor database for the provided source tree.
sourcepub fn record_errors_to(
self: Pin<&mut Self>,
error_collector: Pin<&'a mut dyn MultiFileErrorCollector>,
)
pub fn record_errors_to( self: Pin<&mut Self>, error_collector: Pin<&'a mut dyn MultiFileErrorCollector>, )
Instructs the source tree descriptor database to report any parse errors
to the given MultiFileErrorCollector
.
This should b ecalled before parsing.
sourcepub fn build_file_descriptor_set<P>(
self: Pin<&mut Self>,
roots: &[P],
) -> Result<Pin<Box<FileDescriptorSet>>, OperationFailedError>
pub fn build_file_descriptor_set<P>( self: Pin<&mut Self>, roots: &[P], ) -> Result<Pin<Box<FileDescriptorSet>>, OperationFailedError>
Builds a file descriptor set containing all file descriptor protos reachable from the specified roots.
Trait Implementations§
source§impl<'a> DescriptorDatabase for SourceTreeDescriptorDatabase<'a>
impl<'a> DescriptorDatabase for SourceTreeDescriptorDatabase<'a>
source§fn find_file_by_name(
self: Pin<&mut Self>,
filename: &Path,
) -> Result<Pin<Box<FileDescriptorProto>>, OperationFailedError>
fn find_file_by_name( self: Pin<&mut Self>, filename: &Path, ) -> Result<Pin<Box<FileDescriptorProto>>, OperationFailedError>
Finds a file by file name.
Auto Trait Implementations§
impl<'a> Freeze for SourceTreeDescriptorDatabase<'a>
impl<'a> RefUnwindSafe for SourceTreeDescriptorDatabase<'a>
impl<'a> Send for SourceTreeDescriptorDatabase<'a>
impl<'a> Sync for SourceTreeDescriptorDatabase<'a>
impl<'a> !Unpin for SourceTreeDescriptorDatabase<'a>
impl<'a> UnwindSafe for SourceTreeDescriptorDatabase<'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