pub enum PluginKind {
GithubProjects,
InMemory,
Linear,
LocalMd,
Subprocess,
}Expand description
One of the plugin kinds this build has.
A SourceConfig holds one of these rather than the string a
document spelled, so a configuration naming a plugin nothing answers to cannot exist
past Config::from_document. Resolution therefore has
no “what if the registry does not have it” branch left to get wrong, and the refusal
happens at the one place that can name the offending key.
Variants§
GithubProjects
GitHub Projects.
InMemory
The in-memory source the journeys are written against.
Linear
Linear.
LocalMd
A folder of Markdown files.
Subprocess
A program of its own, speaking docs/plugin-protocol.md over stdio.
Implementations§
Source§impl PluginKind
impl PluginKind
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The name a configuration document’s plugin: field names this kind by.
Spelled here rather than read from the plugin so that matching a name costs no
allocation. every_plugin_kind_names_the_kind_its_own_plugin_reports is what
keeps the two from drifting.
Sourcepub fn parse(name: &str) -> Option<Self>
pub fn parse(name: &str) -> Option<Self>
The kind called name, or None when nothing in this build answers to it.
Sourcepub fn plugin(self) -> Box<dyn SourcePlugin>
pub fn plugin(self) -> Box<dyn SourcePlugin>
This kind’s factory.
Total, which is the point of the type: a PluginKind is one of exactly five
things, so there is no absent-plugin case for a caller to handle or forget.
Trait Implementations§
Source§impl Clone for PluginKind
impl Clone for PluginKind
Source§fn clone(&self) -> PluginKind
fn clone(&self) -> PluginKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PluginKind
Source§impl Debug for PluginKind
impl Debug for PluginKind
Source§impl<'de> Deserialize<'de> for PluginKind
impl<'de> Deserialize<'de> for PluginKind
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>,
Source§impl Display for PluginKind
impl Display for PluginKind
impl Eq for PluginKind
Source§impl From<PluginKind> for String
impl From<PluginKind> for String
Source§fn from(value: PluginKind) -> Self
fn from(value: PluginKind) -> Self
Source§impl FromStr for PluginKind
impl FromStr for PluginKind
Source§impl Hash for PluginKind
impl Hash for PluginKind
Source§impl Ord for PluginKind
impl Ord for PluginKind
Source§fn cmp(&self, other: &PluginKind) -> Ordering
fn cmp(&self, other: &PluginKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PluginKind
impl PartialEq for PluginKind
Source§impl PartialOrd for PluginKind
impl PartialOrd for PluginKind
Source§impl Serialize for PluginKind
impl Serialize for PluginKind
impl StructuralPartialEq for PluginKind
Source§impl TryFrom<String> for PluginKind
impl TryFrom<String> for PluginKind
Source§fn try_from(value: String) -> Result<Self, Self::Error>
fn try_from(value: String) -> Result<Self, Self::Error>
Read a kind this build has, and refuse one it does not — naming what it does have.
Where a document or a protocol message carries a plugin kind, this is what keeps “a kind” and “a kind this binary can build” the same thing: an unknown name stops being representable at the field rather than at a lookup somewhere later.
Auto Trait Implementations§
impl Freeze for PluginKind
impl RefUnwindSafe for PluginKind
impl Send for PluginKind
impl Sync for PluginKind
impl Unpin for PluginKind
impl UnsafeUnpin for PluginKind
impl UnwindSafe for PluginKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.