use crate::context::SproutContext; use alloc::rc::Rc; use alloc::string::String; use anyhow::{Result, bail}; use edera_sprout_config::extractors::ExtractorDeclaration; /// The filesystem device match extractor. pub mod filesystem_device_match; /// Extracts the value using the specified `extractor` under the provided `context`. /// The extractor must return a value, and if a value cannot be determined, an error /// should be returned. pub fn extract(context: Rc, extractor: &ExtractorDeclaration) -> Result { if let Some(filesystem) = &extractor.filesystem_device_match { filesystem_device_match::extract(context, filesystem) } else { bail!("unknown extractor configuration"); } }