pub struct NamingScope {
pub outputs: Vec<ScopedOutput>,
}Expand description
The outputs a command produces: what the paths of its files may depend on.
An ArtifactNamer receives it at every call, so that a path can depend on
the outputs of the command (for instance on their extensions) while the
namer stays a function of its arguments: the namer is contributed when the
registry is built, and the outputs of a command are known only once a plan
is made. Every caller of one run builds it the same way,
NamingScope::of over the registry and the plan’s demands, so it is the
same for every call of the run.
§Examples
use flm_core::core::artifact::{NamingScope, ScopedOutput};
let scope = NamingScope {
outputs: vec![ScopedOutput { name: "html".into(), extension: "html".to_string() }],
};
assert_eq!(scope.outputs[0].extension, "html");Fields§
§outputs: Vec<ScopedOutput>Each output’s name and the file extension of its entry artifact, in the registry’s order.
Implementations§
Source§impl NamingScope
impl NamingScope
Sourcepub fn of(registry: &FlmRegistry, demands: &BTreeSet<CapName>) -> NamingScope
pub fn of(registry: &FlmRegistry, demands: &BTreeSet<CapName>) -> NamingScope
Returns the outputs of registry whose capability is among demands
(a plan’s demands, Plan::demands),
each with the extension of its entry artifact, in the registry’s order.
Nothing demanded gives an empty scope.
Trait Implementations§
Source§impl Clone for NamingScope
impl Clone for NamingScope
Source§impl Debug for NamingScope
impl Debug for NamingScope
Source§impl Default for NamingScope
impl Default for NamingScope
impl Eq for NamingScope
Source§impl PartialEq for NamingScope
impl PartialEq for NamingScope
impl StructuralPartialEq for NamingScope
Auto Trait Implementations§
impl Forget for NamingScope
impl Freeze for NamingScope
impl Move for NamingScope
impl RefUnwindSafe for NamingScope
impl Send for NamingScope
impl Sync for NamingScope
impl Unpin for NamingScope
impl UnsafeUnpin for NamingScope
impl UnwindSafe for NamingScope
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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