#[non_exhaustive]pub struct InstanceSpec {
pub id: InstanceId,
pub name: String,
pub artifact: ArtifactId,
}
Expand description
Exhaustive service instance specification.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: InstanceId
Unique numeric ID of the service instance.
Exonum assigns an ID to the service on instantiation. It is mainly used to route transaction messages belonging to this instance.
name: String
Unique name of the service instance.
The name serves as a primary identifier of this service in most operations. It is assigned by the network administrators.
The name must correspond to the following regular expression: [a-zA-Z0-9/\:-_]+
.
artifact: ArtifactId
Identifier of the corresponding artifact.
Implementations§
Source§impl InstanceSpec
impl InstanceSpec
Sourcepub fn new(
id: InstanceId,
name: impl Into<String>,
artifact: impl AsRef<str>,
) -> Result<Self>
pub fn new( id: InstanceId, name: impl Into<String>, artifact: impl AsRef<str>, ) -> Result<Self>
Creates a new instance specification or return an error if the resulting specification is not correct.
Sourcepub fn from_raw_parts(
id: InstanceId,
name: String,
artifact: ArtifactId,
) -> Self
pub fn from_raw_parts( id: InstanceId, name: String, artifact: ArtifactId, ) -> Self
Creates a new instance specification from prepared parts without any checks.
Sourcepub fn is_valid_name(name: impl AsRef<str>) -> Result<()>
pub fn is_valid_name(name: impl AsRef<str>) -> Result<()>
Checks that the instance name contains only allowed characters and is not empty.
Sourcepub fn as_descriptor(&self) -> InstanceDescriptor
pub fn as_descriptor(&self) -> InstanceDescriptor
Returns the corresponding descriptor of this instance specification.
Trait Implementations§
Source§impl BinaryValue for InstanceSpec
impl BinaryValue for InstanceSpec
Source§impl Clone for InstanceSpec
impl Clone for InstanceSpec
Source§fn clone(&self) -> InstanceSpec
fn clone(&self) -> InstanceSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more