pub struct OwnedSource { /* private fields */ }
Expand description
An OwnedSource owns a text
string with an optional name
denoting the origin.
Implementations§
Source§impl OwnedSource
impl OwnedSource
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 OwnedSource with an optional origin name. Example: OwnedSource::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 OwnedSource with a given origin name. Example: OwnedSource::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 OwnedSource without an origin name. Example: Source::new_unnamed("my text")
Trait Implementations§
Source§impl Debug for OwnedSource
impl Debug for OwnedSource
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 Freeze for OwnedSource
impl RefUnwindSafe for OwnedSource
impl Send for OwnedSource
impl Sync for OwnedSource
impl Unpin for OwnedSource
impl UnwindSafe for OwnedSource
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