Struct reproto_core::Source
[−]
[src]
pub struct Source { /* fields omitted */ }
Methods
impl Source
[src]
pub fn empty<S: AsRef<str>>(name: S) -> Self
[src]
Create a new empty source.
pub fn rope<U: Into<Url>>(url: U, rope: Rope) -> Self
[src]
Create a new empty source.
pub fn bytes<S: AsRef<str>>(name: S, bytes: Vec<u8>) -> Self
[src]
Create a new bytes source.
pub fn from_path<P: AsRef<Path>>(path: P) -> Self
[src]
Create a new path source.
pub fn stdin() -> Self
[src]
Create an source from stdin.
pub fn path(&self) -> Option<&Path>
[src]
Access the path of the source.
pub fn rope_url(&self) -> Option<&Url>
[src]
Access the URL for this source if it is a rope.
pub fn url(&self) -> Option<Url>
[src]
Access the URL for this source.
pub fn as_rope(&self) -> Option<&Rope>
[src]
Access a rope.
pub fn as_mut_rope(&mut self) -> Option<&mut Rope>
[src]
Access a mutable rope.
pub fn read(&self) -> Result<Box<Read>>
[src]
Open up a readable.
pub fn with_name(&self, name: String) -> Self
[src]
Create a copy of this source that has a different name.
pub fn span_to_range(
&self,
span: Span,
encoding: Encoding
) -> Result<(Position, Position)>
[src]
&self,
span: Span,
encoding: Encoding
) -> Result<(Position, Position)>
Trait Implementations
impl Debug for Source
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Source
[src]
fn clone(&self) -> Source
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more