pub struct ExportSpec {
pub name: String,
pub label: Option<String>,
pub gate: Gate,
pub view: Option<String>,
}Expand description
One export a workspace declares for itself: a gate that bounds what leaves, optionally arranged by a view.
Fields§
§name: StringThe key under exports — the export’s public handle (a path segment,
an OCFL object prefix). Deliberately its own name rather than the gate
value’s: the honest name for a readership is routinely one its members
should never read off a URL, and separating them lets two gates share
an arrangement or one gate carry two exports.
label: Option<String>What a person calls it. Absent falls back to the name, humanized.
gate: GateThe gate whose admitted set bounds this export. Required: an export that does not say what may leave is not an export.
view: Option<String>The ViewSpec naming this export’s
arrangement, by its key under views:. None exports the gate’s whole
admitted set. A view may narrow the set; it can never widen it — see
plan.
Implementations§
Source§impl ExportSpec
impl ExportSpec
Sourcepub fn parse(name: &str, value: &Value) -> Option<ExportSpec>
pub fn parse(name: &str, value: &Value) -> Option<ExportSpec>
Read one exports.<name> entry.
Returns None when the entry is not a mapping or carries no readable
Gate. Dropping such an entry is the fail-closed direction — an
unreadable export declaration exports nothing, where defaulting its
gate would export a set nobody chose. crate::diagnose_export is the
half that says why, so a malformed entry is reported rather than
merely dropped.
Sourcepub fn to_mapping(&self) -> IndexMap<String, Value>
pub fn to_mapping(&self) -> IndexMap<String, Value>
The mapping this export writes back as. Absent options are omitted rather than written empty, so an export declared from an app reads as the small thing it is.
Sourcepub fn display_label(&self) -> String
pub fn display_label(&self) -> String
What a person calls this export: its label, else its name humanized.
Trait Implementations§
Source§impl Clone for ExportSpec
impl Clone for ExportSpec
Source§fn clone(&self) -> ExportSpec
fn clone(&self) -> ExportSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExportSpec
impl Debug for ExportSpec
impl Eq for ExportSpec
Source§impl PartialEq for ExportSpec
impl PartialEq for ExportSpec
impl StructuralPartialEq for ExportSpec
Auto Trait Implementations§
impl Freeze for ExportSpec
impl RefUnwindSafe for ExportSpec
impl Send for ExportSpec
impl Sync for ExportSpec
impl Unpin for ExportSpec
impl UnsafeUnpin for ExportSpec
impl UnwindSafe for ExportSpec
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.