pub enum DirQuery {
Root,
NonRoot(ConcreteScriptName),
}
Variants§
Root
NonRoot(ConcreteScriptName)
Implementations§
Source§impl 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 Freeze for DirQuery
impl RefUnwindSafe for DirQuery
impl Send for DirQuery
impl Sync for DirQuery
impl Unpin for DirQuery
impl UnwindSafe for DirQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more