celery_rs_core/connection/
pool_errors.rs

1/*
2Errors for the connection pool
3
4Author Andrew Evans
5*/
6
7use std::fmt;
8
9/// Thrown when the connection pool is empty
10pub struct PoolIsEmptyError;
11
12
13/// Display implementation for when the pool is empty
14impl fmt::Display for PoolIsEmptyError{
15
16    ///Display the standard error message
17    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
18        write!(f, "Connection Pool was Empty")
19    }
20}
21
22
23/// Debut for PoolIsEmptyError
24impl fmt::Debug for PoolIsEmptyError{
25
26    /// Display the debug information for the programmer
27    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
28        write!(f, "{{ file: {}, line: {} }}", file!(), line!()) // programmer-facing output
29    }
30}