pub enum SourceType {
Python(PySourceType),
Toml(TomlSourceType),
Markdown,
}Expand description
The type of a source file.
Variants§
Python(PySourceType)
The file contains Python source code.
Toml(TomlSourceType)
The file contains TOML.
Markdown
The file contains Markdown.
Implementations§
Source§impl SourceType
impl SourceType
Sourcepub fn as_python(&self) -> Option<&PySourceType>
pub fn as_python(&self) -> Option<&PySourceType>
Returns Some if self is a reference of variant Python, and None otherwise.
Sourcepub fn as_mut_python(&mut self) -> Option<&mut PySourceType>
pub fn as_mut_python(&mut self) -> Option<&mut PySourceType>
Returns Some if self is a mutable reference of variant Python, and None otherwise.
Sourcepub fn expect_python(self) -> PySourceTypewhere
Self: Debug,
pub fn expect_python(self) -> PySourceTypewhere
Self: Debug,
Sourcepub fn python(self) -> Option<PySourceType>
pub fn python(self) -> Option<PySourceType>
Returns Some if self is of variant Python, and None otherwise.
Sourcepub fn as_toml(&self) -> Option<&TomlSourceType>
pub fn as_toml(&self) -> Option<&TomlSourceType>
Returns Some if self is a reference of variant Toml, and None otherwise.
Sourcepub fn as_mut_toml(&mut self) -> Option<&mut TomlSourceType>
pub fn as_mut_toml(&mut self) -> Option<&mut TomlSourceType>
Returns Some if self is a mutable reference of variant Toml, and None otherwise.
Sourcepub fn expect_toml(self) -> TomlSourceTypewhere
Self: Debug,
pub fn expect_toml(self) -> TomlSourceTypewhere
Self: Debug,
Sourcepub fn toml(self) -> Option<TomlSourceType>
pub fn toml(self) -> Option<TomlSourceType>
Returns Some if self is of variant Toml, and None otherwise.
Sourcepub const fn is_markdown(&self) -> bool
pub const fn is_markdown(&self) -> bool
Returns true if self is of variant Markdown.
Trait Implementations§
Source§impl Clone for SourceType
impl Clone for SourceType
Source§fn clone(&self) -> SourceType
fn clone(&self) -> SourceType
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 SourceType
impl Debug for SourceType
Source§impl Default for SourceType
impl Default for SourceType
Source§impl PartialEq for SourceType
impl PartialEq for SourceType
impl Copy for SourceType
impl StructuralPartialEq for SourceType
Auto Trait Implementations§
impl Freeze for SourceType
impl RefUnwindSafe for SourceType
impl Send for SourceType
impl Sync for SourceType
impl Unpin for SourceType
impl UnsafeUnpin for SourceType
impl UnwindSafe for SourceType
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more