pub struct SourceName(/* private fields */);Expand description
The name a configuration document gives one configured source.
A plugin learns its own name from
SourcePlugin::build and nowhere else. It quotes it
in an error message, and it compares it against the source segment of a qualified
DependencyEndpoint — which is how a plugin tells a far
end its own backend could have related from one in a system it knows nothing about.
Nothing else about a plugin’s behaviour may depend on it: a source answers the same
way whatever a document chose to call it.
Implementations§
Source§impl SourceName
impl SourceName
Sourcepub fn new(value: impl Into<String>) -> Result<Self, SourceError>
pub fn new(value: impl Into<String>) -> Result<Self, SourceError>
Validate and wrap a source name.
§Errors
Returns SourceError::Config when value does not match
SOURCE_NAME_PATTERN.
Trait Implementations§
Source§impl Clone for SourceName
impl Clone for SourceName
Source§fn clone(&self) -> SourceName
fn clone(&self) -> SourceName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceName
impl Debug for SourceName
Source§impl<'de> Deserialize<'de> for SourceName
impl<'de> Deserialize<'de> for SourceName
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SourceName
impl Display for SourceName
impl Eq for SourceName
Source§impl From<SourceName> for String
impl From<SourceName> for String
Source§fn from(value: SourceName) -> Self
fn from(value: SourceName) -> Self
Converts to this type from the input type.
Source§impl Hash for SourceName
impl Hash for SourceName
Source§impl JsonSchema for SourceName
impl JsonSchema for SourceName
Source§fn json_schema(_generator: &mut SchemaGenerator) -> Schema
fn json_schema(_generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for SourceName
impl Ord for SourceName
Source§fn cmp(&self, other: &SourceName) -> Ordering
fn cmp(&self, other: &SourceName) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for SourceName
impl PartialEq for SourceName
Source§impl PartialOrd for SourceName
impl PartialOrd for SourceName
Source§impl Serialize for SourceName
impl Serialize for SourceName
impl StructuralPartialEq for SourceName
Auto Trait Implementations§
impl Freeze for SourceName
impl RefUnwindSafe for SourceName
impl Send for SourceName
impl Sync for SourceName
impl Unpin for SourceName
impl UnsafeUnpin for SourceName
impl UnwindSafe for SourceName
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
Mutably borrows from an owned value. Read more