use crate::error::{Error, Result};
const FEATURE: &str = "scope";
const DETAILS: &str = "the box needs `POST :9000/net/command` scope/logic roles (or a \
dedicated capture endpoint) for trigger config, single capture, and \
measurement queries; see MISSING_ENDPOINTS.md";
fn unsupported<T>() -> Result<T> {
Err(Error::NotSupportedByBox {
feature: FEATURE,
details: DETAILS,
})
}
#[derive(Debug, Clone)]
pub struct Scope {
name: String,
}
impl Scope {
pub(crate) fn new(name: impl Into<String>) -> Self {
Scope { name: name.into() }
}
pub fn name(&self) -> &str {
&self.name
}
pub fn enable(&self) -> Result<()> {
unsupported()
}
pub fn disable(&self) -> Result<()> {
unsupported()
}
pub fn capture(&self) -> Result<Vec<f64>> {
unsupported()
}
pub fn measure(&self, _item: &str) -> Result<f64> {
unsupported()
}
}