pub const SEARCH_STRUCTURES: &str = "esi-search.search_structures.v1";
pub struct SearchScopes {
pub(super) scopes: Vec<String>,
}
impl Default for SearchScopes {
fn default() -> Self {
Self::new()
}
}
impl SearchScopes {
pub fn new() -> Self {
SearchScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
SearchScopes::new().search_structures()
}
pub fn search_structures(mut self) -> Self {
self.scopes.push(SEARCH_STRUCTURES.to_string());
self
}
}
#[cfg(test)]
mod search_scopes_tests {
use crate::scope::SearchScopes;
#[test]
fn test_search_scopes_default() {
let search_scopes = SearchScopes::default();
assert_eq!(search_scopes.scopes.len(), 0)
}
}