pub struct PiecesRenderOptions {
pub include: BTreeSet<Name>,
pub exclude: BTreeSet<Name>,
pub backends: BTreeMap<BackendName, BTreeSet<Name>>,
}Expand description
The render option with which the pieces placed during a render are selected.
A piece is placed during a render if it is listed in include, or if it is
placed by default
(PieceDecl::default_on)
and is not listed in exclude. A piece that is listed in both sets is
therefore placed. The two sets apply to every backend of the render.
The field backends restricts this selection for each
backend separately:
- On a backend that has an entry in
backends, only the selected pieces listed in this entry are placed. - On a backend without an entry, all selected pieces are placed, unless the
pieces stage of the backend places only the pieces listed for it
(
PiecesStage::placing_only_named). In that case, no piece is placed on this backend.
The function selected_pieces applies these rules.
The option is set on the render request (Bind::Render). A piece that is
not placed during a render is not built: the stage that builds the content
of the piece is not scheduled in the plan. A name in include or exclude
that is not the name of a piece defined in any feature is ignored, and
reported as flm.pieces.unknown-piece
(UnknownPiece).
§Examples
use flm_core::stdlib::backends::pieces::PiecesRenderOptions;
let options = PiecesRenderOptions::default().exclude("mypkg.notes");
assert!(options.exclude.iter().any(|name| name.as_str() == "mypkg.notes"));
assert!(options.include.is_empty());Fields§
§include: BTreeSet<Name>Pieces to be placed during a render although they are not placed by
default, such as flm.toc.
exclude: BTreeSet<Name>Pieces placed by default that are left out of a render.
backends: BTreeMap<BackendName, BTreeSet<Name>>For each backend that has an entry, the only pieces that the backend may place.
A host sets this field from the pieces that its compose template
accepts
(select_pieces),
so that a piece for which the template has no place is never built. This
field cannot be set as a setting.
Implementations§
Trait Implementations§
Source§impl Clone for PiecesRenderOptions
impl Clone for PiecesRenderOptions
Source§impl Debug for PiecesRenderOptions
impl Debug for PiecesRenderOptions
Source§impl Default for PiecesRenderOptions
impl Default for PiecesRenderOptions
Source§impl<'de> Deserialize<'de> for PiecesRenderOptionswhere
PiecesRenderOptions: Default,
impl<'de> Deserialize<'de> for PiecesRenderOptionswhere
PiecesRenderOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PiecesRenderOptions
Source§impl Hash for PiecesRenderOptions
impl Hash for PiecesRenderOptions
Source§impl JsonSchema for PiecesRenderOptions
impl JsonSchema for PiecesRenderOptions
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for PiecesRenderOptions
impl PartialEq for PiecesRenderOptions
impl StructuralPartialEq for PiecesRenderOptions
Auto Trait Implementations§
impl Forget for PiecesRenderOptions
impl Freeze for PiecesRenderOptionswhere
*const LeafNode<Name, SetValZST> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(Name, SetValZST)>>: Freeze,
*const LeafNode<BackendName, BTreeSet<Name>> is !null: Freeze,
PhantomData<Box<(BackendName, BTreeSet<Name>)>>: Freeze,
impl Move for PiecesRenderOptions
impl RefUnwindSafe for PiecesRenderOptions
impl Send for PiecesRenderOptions
impl Sync for PiecesRenderOptions
impl Unpin for PiecesRenderOptions
impl UnsafeUnpin for PiecesRenderOptionswhere
*const LeafNode<Name, SetValZST> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(Name, SetValZST)>>: UnsafeUnpin,
*const LeafNode<BackendName, BTreeSet<Name>> is !null: UnsafeUnpin,
PhantomData<Box<(BackendName, BTreeSet<Name>)>>: UnsafeUnpin,
impl UnwindSafe for PiecesRenderOptions
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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