[−][src]Struct exonum::runtime::ArtifactId
The artifact identifier is required to construct service instances. In other words, an artifact identifier is similar to a class name, and a specific service instance is similar to a class instance.
An artifact ID has the following string representation:
{runtime_id}:{artifact_name}:{version}
where:
runtime_id
is a runtime identifier,artifact_name
is the name of the artifactversion
is the artifact semantic version
Artifact name may contain the following characters: a-zA-Z0-9
and _.-
.
Examples
// Typical Rust artifact. let rust_artifact_id = "0:my-service:1.0.0".parse::<ArtifactId>()?; // Typical Java artifact. let java_artifact_id = "1:com.exonum.service:1.0.0".parse::<ArtifactId>()?;
Fields (Non-exhaustive)
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.runtime_id: u32
Runtime identifier.
name: String
Artifact name.
version: Version
Semantic version of the artifact.
Methods
impl ArtifactId
[src]
pub fn new(
runtime_id: impl Into<u32>,
name: impl Into<String>,
version: Version
) -> Result<Self>
[src]
runtime_id: impl Into<u32>,
name: impl Into<String>,
version: Version
) -> Result<Self>
Creates a new artifact identifier from the given runtime id and name or returns error if the resulting artifact id is not correct.
pub fn from_raw_parts(runtime_id: u32, name: String, version: Version) -> Self
[src]
Creates a new artifact identifier from prepared parts without any checks.
Use this method only if you don't need an artifact verification (e.g. in tests).
Stability
Since the internal structure of ArtifactId
can change, this method is considered
unstable and can break in the future.
pub fn is_upgrade_of(&self, other: &Self) -> bool
[src]
Checks if the specified artifact is an upgraded version of another artifact.
pub fn into_default_instance(
self,
id: InstanceId,
name: impl Into<String>
) -> InstanceInitParams
[src]
self,
id: InstanceId,
name: impl Into<String>
) -> InstanceInitParams
Converts into InstanceInitParams
with the given IDs and an empty constructor.
Trait Implementations
impl BinaryKey for ArtifactId
[src]
fn size(&self) -> usize
[src]
fn write(&self, buffer: &mut [u8]) -> usize
[src]
fn read(buffer: &[u8]) -> Self::Owned
[src]
impl BinaryValue for ArtifactId
[src]
fn to_bytes(&self) -> Vec<u8>
[src]
fn from_bytes(value: Cow<[u8]>) -> Result<Self, Error>
[src]
fn into_bytes(self) -> Vec<u8>
[src]
impl Clone for ArtifactId
[src]
fn clone(&self) -> ArtifactId
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ArtifactId
[src]
impl<'de> Deserialize<'de> for ArtifactId
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for ArtifactId
[src]
impl Eq for ArtifactId
[src]
impl FromStr for ArtifactId
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for ArtifactId
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl ObjectHash for ArtifactId
[src]
fn object_hash(&self) -> Hash
[src]
impl Ord for ArtifactId
[src]
fn cmp(&self, other: &ArtifactId) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<ArtifactId> for ArtifactId
[src]
fn eq(&self, other: &ArtifactId) -> bool
[src]
fn ne(&self, other: &ArtifactId) -> bool
[src]
impl PartialOrd<ArtifactId> for ArtifactId
[src]
fn partial_cmp(&self, other: &ArtifactId) -> Option<Ordering>
[src]
fn lt(&self, other: &ArtifactId) -> bool
[src]
fn le(&self, other: &ArtifactId) -> bool
[src]
fn gt(&self, other: &ArtifactId) -> bool
[src]
fn ge(&self, other: &ArtifactId) -> bool
[src]
impl ProtobufConvert for ArtifactId
[src]
type ProtoStruct = ArtifactId
Type generated from the Protobuf definition.
fn from_pb(pb: Self::ProtoStruct) -> Result<Self, Error>
[src]
fn to_pb(&self) -> Self::ProtoStruct
[src]
impl Serialize for ArtifactId
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for ArtifactId
[src]
impl StructuralPartialEq for ArtifactId
[src]
impl ValidateInput for ArtifactId
[src]
Auto Trait Implementations
impl RefUnwindSafe for ArtifactId
impl Send for ArtifactId
impl Sync for ArtifactId
impl Unpin for ArtifactId
impl UnwindSafe for ArtifactId
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,