pub struct Parser { /* private fields */ }
Expand description
Configure and invoke .proto
parser.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn includes(
&mut self,
includes: impl IntoIterator<Item = impl AsRef<Path>>,
) -> &mut Self
pub fn includes( &mut self, includes: impl IntoIterator<Item = impl AsRef<Path>>, ) -> &mut Self
Add include directories.
Sourcepub fn input(&mut self, input: impl AsRef<Path>) -> &mut Self
pub fn input(&mut self, input: impl AsRef<Path>) -> &mut Self
Append a .proto
file path to compile
Sourcepub fn inputs(
&mut self,
inputs: impl IntoIterator<Item = impl AsRef<Path>>,
) -> &mut Self
pub fn inputs( &mut self, inputs: impl IntoIterator<Item = impl AsRef<Path>>, ) -> &mut Self
Append multiple .proto
file paths to compile
Sourcepub fn protoc_path(&mut self, protoc: &Path) -> &mut Self
pub fn protoc_path(&mut self, protoc: &Path) -> &mut Self
Specify protoc
path used for parsing.
This is ignored if pure rust parser is used.
Sourcepub fn protoc_extra_args(
&mut self,
args: impl IntoIterator<Item = impl AsRef<OsStr>>,
) -> &mut Self
pub fn protoc_extra_args( &mut self, args: impl IntoIterator<Item = impl AsRef<OsStr>>, ) -> &mut Self
Extra arguments to pass to protoc
command (like experimental options).
This is ignored if pure rust parser is used.
Sourcepub fn capture_stderr(&mut self) -> &mut Self
pub fn capture_stderr(&mut self) -> &mut Self
Capture stderr and return it in error.
This option applies only to protoc
parser.
By default protoc
stderr is inherited from this process stderr.
Sourcepub fn parse_and_typecheck(&self) -> Result<ParsedAndTypechecked>
pub fn parse_and_typecheck(&self) -> Result<ParsedAndTypechecked>
Parse .proto
files and typecheck them using pure Rust parser of protoc
command.
Sourcepub fn file_descriptor_set(&self) -> Result<FileDescriptorSet>
pub fn file_descriptor_set(&self) -> Result<FileDescriptorSet>
Parse and convert result to FileDescriptorSet
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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