pub struct Registered<'a>(/* private fields */);Expand description
A registered input. See crate::registry::Inputs::get.
Implementations§
Source§impl Registered<'_>
impl Registered<'_>
Sourcepub fn tag(&self) -> &'static str
pub fn tag(&self) -> &'static str
Return the input tag of the registered input.
See: Input::tag.
Sourcepub fn try_deserialize(
&self,
serialized: &Value,
checker: &mut Checker,
) -> Result<Any>
pub fn try_deserialize( &self, serialized: &Value, checker: &mut Checker, ) -> Result<Any>
Try to deserialize raw JSON into the dynamic type of the input.
See: Input::try_deserialize.
Sourcepub fn example(&self) -> Result<Value>
pub fn example(&self) -> Result<Value>
Return an example JSON for the dynamic type of the input.
See: Input::example.
Trait Implementations§
Source§impl<'a> Clone for Registered<'a>
impl<'a> Clone for Registered<'a>
Source§fn clone(&self) -> Registered<'a>
fn clone(&self) -> Registered<'a>
Returns a duplicate of the value. Read more
1.0.0 · 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 Registered<'_>
impl Debug for Registered<'_>
impl<'a> Copy for Registered<'a>
Auto Trait Implementations§
impl<'a> Freeze for Registered<'a>
impl<'a> !RefUnwindSafe for Registered<'a>
impl<'a> !Send for Registered<'a>
impl<'a> !Sync for Registered<'a>
impl<'a> Unpin for Registered<'a>
impl<'a> UnsafeUnpin for Registered<'a>
impl<'a> !UnwindSafe for Registered<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DispatchRule<T> for T
impl<T> DispatchRule<T> for T
Source§type Error = Infallible
type Error = Infallible
Errors that can occur during
convert.Source§fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
Source§fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
Perform the actual conversion. Read more
Source§fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
Write a description of the dispatch rule and outcome to the formatter. Read more
Source§fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
The equivalent of
try_match but returns a reason for a failed score. Read more