pub struct DescriptorDataConfig { /* private fields */ }Expand description
Configures a DescriptorData instance to gather information from a protobuf descriptor,
which can be useful to apply attributes programmatically to the target items.
You can then collect the data while also setting up the validators with the set_up_validators method.
Should you wish to not collect any data at all, you can call the omonimous function set_up_validators exported to the root, which will set up the validators and return an empty DescriptorData instance.
Implementations§
Source§impl DescriptorDataConfig
impl DescriptorDataConfig
Sourcepub fn set_up_validators(
&self,
config: &mut Config,
files: &[impl AsRef<Path>],
include_paths: &[impl AsRef<Path>],
packages: &[&str],
) -> Result<DescriptorData, Box<dyn Error>>
pub fn set_up_validators( &self, config: &mut Config, files: &[impl AsRef<Path>], include_paths: &[impl AsRef<Path>], packages: &[&str], ) -> Result<DescriptorData, Box<dyn Error>>
Sets up the validators for the specified packages, while also collecting the data that was requested
in the configuration. Refer to the omonimous set_up_validators function’s documentation to learn more about the implementations provided by this method.
Sourcepub const fn collect_all_data() -> Self
pub const fn collect_all_data() -> Self
Collects data for all items: oneofs, enums and messages.
Sourcepub const fn collect_oneofs_data(self) -> Self
pub const fn collect_oneofs_data(self) -> Self
Toggles collection of data for oneofs.
Sourcepub const fn collect_enums_data(self) -> Self
pub const fn collect_enums_data(self) -> Self
Toggles collection of data for enums.
Sourcepub const fn collect_messages_data(self) -> Self
pub const fn collect_messages_data(self) -> Self
Toggles collection of data for messages.
Trait Implementations§
Source§impl Default for DescriptorDataConfig
impl Default for DescriptorDataConfig
Source§fn default() -> DescriptorDataConfig
fn default() -> DescriptorDataConfig
Auto Trait Implementations§
impl Freeze for DescriptorDataConfig
impl RefUnwindSafe for DescriptorDataConfig
impl Send for DescriptorDataConfig
impl Sync for DescriptorDataConfig
impl Unpin for DescriptorDataConfig
impl UnwindSafe for DescriptorDataConfig
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
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>
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>
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