Sha256: bca524b36621ac56044cbe3eebf8892f7a3b398fd8f257fc67b17b26ae34bfbf

Contents?: true

Size: 956 Bytes

Versions: 3

Compression:

Stored size: 956 Bytes

Contents

use displaydoc::Display;

#[derive(Debug, Display)]
pub enum DataStoreError {
    /// data store disconnected
    Disconnect,
    /// the data for key `{0}` is not available
    Redaction(String),
    /// invalid header (expected {expected:?}, found {found:?})
    InvalidHeader { expected: String, found: String },
    /// unknown data store error
    Unknown,
}

fn main() {
    let disconnect = DataStoreError::Disconnect;
    println!(
        "Enum value `Disconnect` should be printed as:\n\t{}",
        disconnect
    );

    let redaction = DataStoreError::Redaction(String::from("Dummy"));
    println!(
        "Enum value `Redaction` should be printed as:\n\t{}",
        redaction
    );

    let invalid_header = DataStoreError::InvalidHeader {
        expected: String::from("https"),
        found: String::from("http"),
    };
    println!(
        "Enum value `InvalidHeader` should be printed as:\n\t{}",
        invalid_header
    );
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/displaydoc-0.2.5/examples/simple.rs
wasmtime-28.0.0 ./ext/cargo-vendor/displaydoc-0.2.5/examples/simple.rs
wasmtime-27.0.0 ./ext/cargo-vendor/displaydoc-0.2.5/examples/simple.rs