Struct pastebin::DbError [] [src]

pub struct DbError(_);

A helper type that implements the std::error::Error trait to store an arbitrary error.

Use DbError::new() to create a new instance.

Example

use pastebin::DbError;
use std::fs::File;

fn foo() -> Result<File, DbError> {
  let f = File::create("/tmp/test").map_err(DbError::new)?;
  Ok(f)
}

Methods

impl DbError
[src]

[src]

A helper method that creates a new instance of DbError from an arbitrary error.

Trait Implementations

impl Debug for DbError
[src]

[src]

Formats the value using the given formatter.