1use anyhow::Error as AnyError;
6use thiserror::Error;
7
8#[derive(Debug, Error)]
10#[non_exhaustive]
11#[allow(clippy::error_impl_error)]
12pub enum Error {
13 #[error("apt-parse internal error")]
15 InternalError(#[source] AnyError),
16
17 #[error("Not implemented yet: {0}")]
19 NotImplemented(String),
20
21 #[error("Could not parse the output of `apt-cache policy`")]
23 ParsePolicy(#[source] AnyError),
24}
25
26#[derive(Debug, Default)]
28pub struct Config {
29 verbose: bool,
31}
32
33impl Config {
34 #[inline]
36 #[must_use]
37 pub const fn verbose(&self) -> bool {
38 self.verbose
39 }
40
41 #[inline]
43 #[must_use]
44 pub const fn with_verbose(self, verbose: bool) -> Self {
45 Self { verbose }
46 }
47}