portfu_core 1.1.0

Portfu Core Types and Definitions Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::service::Service;
use std::fmt::{Debug, Formatter};

pub trait EditFn {
    type Error;
    fn name(&self) -> &str;
    fn edit(&self, service: Service) -> Result<Service, (Self::Error, Service)>;
}
impl<T> Debug for (dyn EditFn<Error = T> + Send + Sync + 'static) {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.name())
    }
}