pub struct Code { /* private fields */ }
Expand description
A code.
Implementations§
Source§impl Code
impl Code
Sourcepub fn try_new(
kind: Kind,
grammar: Version,
index: usize,
) -> Result<Self, Error>
pub fn try_new( kind: Kind, grammar: Version, index: usize, ) -> Result<Self, Error>
Attempts to create a new Code
.
§Examples
use wdl_core::concern::code::Kind;
use wdl_core::concern::Code;
use wdl_core::Version;
let code = Code::try_new(Kind::Warning, Version::V1, 1)?;
assert_eq!(code.kind(), &Kind::Warning);
assert_eq!(code.grammar(), &Version::V1);
assert_eq!(code.index().get(), 1);
Sourcepub fn index(&self) -> NonZeroUsize
pub fn index(&self) -> NonZeroUsize
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Code
impl<'de> Deserialize<'de> for Code
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 Ord for Code
impl Ord for Code
Source§impl PartialOrd for Code
impl PartialOrd for Code
impl Eq for Code
impl StructuralPartialEq for Code
Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
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