pub struct Source<'a> { /* private fields */ }
Expand description
Implementations§
Source§impl<'a> Source<'a>
impl<'a> Source<'a>
Sourcepub fn new<N, T>(optname: Option<N>, text: T) -> Self
pub fn new<N, T>(optname: Option<N>, text: T) -> Self
Create a new Source with an optional origin name. Example: Source::new(Some("<built-in>"), "my text")
Sourcepub fn new_named<N, T>(name: N, text: T) -> Self
pub fn new_named<N, T>(name: N, text: T) -> Self
Create a new Source with a given origin name. Example: Source::new_named("<built-in>", "my text")
Sourcepub fn new_unnamed<T>(text: T) -> Self
pub fn new_unnamed<T>(text: T) -> Self
Create a new Source without an origin name. Example: Source::new_unnamed("my text")
Trait Implementations§
Source§impl<'a> From<OwnedSource> for Source<'a>
impl<'a> From<OwnedSource> for Source<'a>
Source§fn from(s: OwnedSource) -> Source<'a>
fn from(s: OwnedSource) -> Source<'a>
Converts to this type from the input type.
Source§impl<'a> From<Source<'a>> for OwnedSource
impl<'a> From<Source<'a>> for OwnedSource
Source§fn from(s: Source<'a>) -> OwnedSource
fn from(s: Source<'a>) -> OwnedSource
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for Source<'a>
impl<'a> RefUnwindSafe for Source<'a>
impl<'a> Send for Source<'a>
impl<'a> Sync for Source<'a>
impl<'a> Unpin for Source<'a>
impl<'a> UnwindSafe for Source<'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