[][src]Struct exonum::runtime::InstanceSpec

#[non_exhaustive]pub struct InstanceSpec {
    pub id: InstanceId,
    pub name: String,
    pub artifact: ArtifactId,
}

Exhaustive service instance specification.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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.

Methods

impl InstanceSpec[src]

pub fn new(
    id: InstanceId,
    name: impl Into<String>,
    artifact: impl AsRef<str>
) -> Result<Self>
[src]

Creates a new instance specification or return an error if the resulting specification is not correct.

pub fn from_raw_parts(
    id: InstanceId,
    name: String,
    artifact: ArtifactId
) -> Self
[src]

Creates a new instance specification from prepared parts without any checks.

pub fn is_valid_name(name: impl AsRef<str>) -> Result<()>[src]

Checks that the instance name contains only allowed characters and is not empty.

pub fn as_descriptor(&self) -> InstanceDescriptor[src]

Returns the corresponding descriptor of this instance specification.

Trait Implementations

impl BinaryValue for InstanceSpec[src]

impl Clone for InstanceSpec[src]

impl Debug for InstanceSpec[src]

impl<'de> Deserialize<'de> for InstanceSpec[src]

impl Display for InstanceSpec[src]

impl Eq for InstanceSpec[src]

impl From<InstanceSpec> for InstanceInitParams[src]

impl Hash for InstanceSpec[src]

impl ObjectHash for InstanceSpec[src]

impl PartialEq<InstanceSpec> for InstanceSpec[src]

impl ProtobufConvert for InstanceSpec[src]

type ProtoStruct = InstanceSpec

Type generated from the Protobuf definition.

impl Serialize for InstanceSpec[src]

impl StructuralEq for InstanceSpec[src]

impl StructuralPartialEq for InstanceSpec[src]

impl ValidateInput for InstanceSpec[src]

type Error = Error

The type returned in the event of a validate error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,