pub struct SiteRoot { /* private fields */ }Expand description
The path one site reaches its published stamp by.
Structurally non-empty, and read the way the language reads a path: qualifiers only at the root — crate, self, or a leading run of super — and an item name at every later step, so a root the consumer’s compiler would read as something else is not a value anybody can hold.
Usually one segment: the crate the stamp is published in names its own root, and a site elsewhere names that crate.
Implementations§
Source§impl SiteRoot
impl SiteRoot
Sourcepub fn spelled(segments: Vec<String>) -> Result<Self, StampError>
pub fn spelled(segments: Vec<String>) -> Result<Self, StampError>
The path one site reaches its stamp by, parsed from the segments the caller stated.
§Errors
Returns StampError::NotAnIdentifier where a segment cannot name a step of a site’s path, StampError::PathEmpty where no segment was stated, and StampError::PathUnbounded where the segments outgrow the declared magnitude.
The checks are in that order, so exactly one cause is true of any refused root.
The reading is position-aware the way the language’s own path grammar is: the root position admits the qualifiers a site lawfully roots itself under — crate, self, or a leading run of super — and every segment past the qualifiers names an item, read against the composed law that refuses the keyword roster.