Enum hyper_scripter::query::DirQuery
source · [−]pub enum DirQuery {
Root,
NonRoot(ConcreteScriptName),
}Variants
Root
NonRoot(ConcreteScriptName)
Implementations
sourceimpl DirQuery
impl DirQuery
sourcepub fn join(self, other: &ScriptName) -> ConcreteScriptName
pub fn join(self, other: &ScriptName) -> ConcreteScriptName
接上另一個 ScriptName
use hyper_scripter::query::*;
use hyper_scripter::script::*;
let root = DirQuery::Root;
let joined = root.clone().join(&".42".to_owned().into_script_name().unwrap());
assert_eq!(joined.to_string(), "42");
let joined = root.join(&"a/b/c".to_owned().into_script_name().unwrap());
assert_eq!(joined.to_string(), "c");
let dir = DirQuery::NonRoot(ConcreteScriptName::new("dir".into()).unwrap());
let joined = dir.clone().join(&".42".to_owned().into_script_name().unwrap());
assert_eq!(joined.to_string(), "dir/42");
let joined = dir.join(&"a/b/c".to_owned().into_script_name().unwrap());
assert_eq!(joined.to_string(), "dir/c");Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DirQuery
impl Send for DirQuery
impl Sync for DirQuery
impl Unpin for DirQuery
impl UnwindSafe for DirQuery
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more