Struct zksync_protobuf_build::ProtoName
source · pub struct ProtoName(/* private fields */);
Expand description
In addition to input paths and proto paths, there are also proto names which are used to reference message types from different proto files. Theoretically proto names can be totally independent from the proto paths (i.e. you can have “my.favorite.package” proto package defined in “totally/unrelated/file/name.proto” file, but we recommend the following naming convention: proto package “a.b.c” should be defined either: a) in a single file “a/b/c.proto”, or b) in a collection of files under “a/b/c/” directory Option b) is useful for defining large packages, because there is no equivalent of “pub use” in proto syntax.
Implementations§
source§impl ProtoName
impl ProtoName
sourcepub fn starts_with(&self, prefix: &Self) -> bool
pub fn starts_with(&self, prefix: &Self) -> bool
Checks if package path starts with the given prefix.
sourcepub fn relative_to(&self, prefix: &Self) -> Result<Self>
pub fn relative_to(&self, prefix: &Self) -> Result<Self>
Strips a given prefix from the name.
sourcepub fn to_rust_module(&self) -> Result<RustName>
pub fn to_rust_module(&self) -> Result<RustName>
Converts proto package name to rust module name according to prost_build
rules.
sourcepub fn to_rust_type(&self) -> Result<RustName>
pub fn to_rust_type(&self) -> Result<RustName>
Converts proto message name to rust type name according to prost_build
rules.
Trait Implementations§
source§impl PartialEq for ProtoName
impl PartialEq for ProtoName
impl Eq for ProtoName
impl StructuralPartialEq for ProtoName
Auto Trait Implementations§
impl Freeze for ProtoName
impl RefUnwindSafe for ProtoName
impl Send for ProtoName
impl Sync for ProtoName
impl Unpin for ProtoName
impl UnwindSafe for ProtoName
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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