bnymn-category 0.1.0

This package allows you to manage categories of any kind
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{CategoryRepository, CategoryEntity};

pub struct CategoryReader<'a> {
    category_repository: &'a Box<dyn CategoryRepository>,
}

impl<'a> CategoryReader<'a> {
    pub fn new(category_repository: &'a Box<dyn CategoryRepository>) -> Self {
        Self {
            category_repository
        }
    }

    pub fn find_by_id(&self, category_id: u64) -> Option<CategoryEntity> {
        self.category_repository.find_by_id(category_id)
    }
}