use super::InputType;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct DependencySpec {
name: &'static str,
input: InputType,
optional: bool,
}
impl DependencySpec {
#[must_use]
#[inline]
pub const fn new(name: &'static str, input: InputType, optional: bool) -> Self {
assert!(!name.is_empty(), "dependency name cannot be empty");
Self { name, input, optional }
}
#[must_use]
#[inline]
pub const fn name(self) -> &'static str {
self.name
}
#[must_use]
#[inline]
pub const fn input(self) -> InputType {
self.input
}
#[must_use]
#[inline]
pub const fn optional(self) -> bool {
self.optional
}
}