#[non_exhaustive]pub struct WriteOptions {
pub label: String,
pub overwrite_unowned: bool,
pub allow_partial: bool,
pub source_id: Option<String>,
pub replace_source: bool,
}Expand description
How a write() treats the output directory.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.label: StringNames this generation target, together with the language. Two targets writing to one directory need different labels, and their generated files need different names.
overwrite_unowned: boolOverwrite an existing file that no manifest owns. Off by default: such a file is probably hand-written. One that already holds exactly the generated content is adopted either way, since nothing is lost.
allow_partial: boolWrite a generation that carries Error diagnostics. Off by
default: such a generation is missing the types the errors
suppressed. When it writes such a generation, files the previous run
wrote are kept rather than removed as stale; a clean generation
removes them as usual.
source_id: Option<String>What this label was generated from, recorded in the manifest. When
set, a later run under the same label from a different source is
refused, so two descriptions cannot overwrite each other’s output.
The roas command line uses the description’s path relative to
the output directory, without a .json/.yaml/.yml extension,
so moving between JSON and YAML keeps the label. An empty id counts
as none, and switches the check off: use a non-empty one, such as
., for a source that has no shorter name.
replace_source: boolAccept a different source_id than the one the
label recorded, and record the new one: the description moved or was
renamed. Off by default, so a second description cannot take over a
label by accident.
Implementations§
Trait Implementations§
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
Source§impl Debug for WriteOptions
impl Debug for WriteOptions
impl Eq for WriteOptions
Source§impl PartialEq for WriteOptions
impl PartialEq for WriteOptions
impl StructuralPartialEq for WriteOptions
Auto Trait Implementations§
impl Forget for WriteOptions
impl Freeze for WriteOptions
impl Move for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptionswhere
RawVecInner: Send,
impl Sync for WriteOptionswhere
RawVecInner: Sync,
impl Unpin for WriteOptions
impl UnsafeUnpin for WriteOptions
impl UnwindSafe for WriteOptionswhere
RawVecInner: UnwindSafe,
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
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§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.