[][src]Struct exonum_middleware_service::ArtifactReq

pub struct ArtifactReq(pub ArtifactReq);

A wrapper around an artifact requirement.

Necessary as a separate type because of Rust orphaning rules: we want to use the requirement as a stub, but the return type (CheckedCall) is defined in this crate.

Examples

let req: ArtifactReq = "some.Service@^1.3.0".parse().unwrap();

// Suppose the interface for `some.Service` is defined as follows:
#[exonum_interface]
trait SomeService<Ctx> {
    type Output;
    #[interface_method(id = 0)]
    fn do_something(&self, ctx: Ctx, arg: String) -> Self::Output;
}

// Then, requirements can be used to perform a checked call to the service.
const SERVICE_ID: InstanceId = 100;
let checked_call: CheckedCall = req.do_something(SERVICE_ID, "Arg".into());

Trait Implementations

impl Clone for ArtifactReq[src]

impl Debug for ArtifactReq[src]

impl Display for ArtifactReq[src]

impl From<ArtifactReq> for ArtifactReq[src]

impl From<ArtifactReq> for ArtifactReq[src]

impl FromStr for ArtifactReq[src]

type Err = <ArtifactReq as FromStr>::Err

The associated error which can be returned from parsing.

impl GenericCall<u32> for ArtifactReq[src]

type Output = CheckedCall

Type of values output by the stub.

impl PartialEq<ArtifactReq> for ArtifactReq[src]

impl StructuralPartialEq for ArtifactReq[src]

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> Erased for T

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>,