Struct protobuf_parse::Parser
source · [−]pub struct Parser { /* private fields */ }
Expand description
Configure and invoke .proto
parser.
Implementations
sourceimpl 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 RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more