pub enum LintProtoType {
String,
Bytes,
SignedInteger,
UnsignedInteger,
Float,
Numeric,
Bool,
Other(String),
}Expand description
Proto wire type a field declares. The proto-first path fills this
from FieldDescriptorProto::r#type; the derive path fills it from
the Rust syntactic type via LintProtoType::from_rust_token. When
the type cannot be inferred it is Other(_) and the type-checking
portion of L014 simply does not fire.
Variants§
String
string / &str / String.
Bytes
bytes / Vec<u8> / Bytes.
SignedInteger
Signed integer scalar.
UnsignedInteger
Unsigned integer scalar.
Float
Floating-point scalar.
Numeric
Numeric scalar whose signedness/width is not known.
Bool
bool.
Other(String)
Unknown; type-aware lints skip.
Implementations§
Source§impl LintProtoType
impl LintProtoType
Sourcepub fn from_rust_token(s: &str) -> Self
pub fn from_rust_token(s: &str) -> Self
Map a Rust type’s ToTokens form to a LintProtoType. Heuristic
only — covers the common cases (String, Vec<u8>, integers,
bool); anything else lands in Other(_) and L014’s
type-validation skips.
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Whether the type is any numeric scalar.
Trait Implementations§
Source§impl Clone for LintProtoType
impl Clone for LintProtoType
Source§fn clone(&self) -> LintProtoType
fn clone(&self) -> LintProtoType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LintProtoType
impl Debug for LintProtoType
Source§impl PartialEq for LintProtoType
impl PartialEq for LintProtoType
Source§fn eq(&self, other: &LintProtoType) -> bool
fn eq(&self, other: &LintProtoType) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for LintProtoType
impl StructuralPartialEq for LintProtoType
Auto Trait Implementations§
impl Freeze for LintProtoType
impl RefUnwindSafe for LintProtoType
impl Send for LintProtoType
impl Sync for LintProtoType
impl Unpin for LintProtoType
impl UnsafeUnpin for LintProtoType
impl UnwindSafe for LintProtoType
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