pub struct SourceFile(Id);Tuple Fields§
§0: IdImplementations§
Source§impl SourceFile
impl SourceFile
pub fn ingredient(db: &dyn Database) -> &IngredientImpl<Self>
pub fn ingredient_mut( db: &mut dyn Database, ) -> (&mut IngredientImpl<Self>, &mut Runtime)
Source§impl SourceFile
impl SourceFile
pub fn new<Db_>(db: &Db_, url: Url, contents: Result<String, String>) -> Selfwhere
Db_: ?Sized + Database,
pub fn builder( url: Url, contents: Result<String, String>, ) -> <Self as HasBuilder>::Builder
pub fn url<'db, Db_>(self, db: &'db Db_) -> &'db Urlwhere
Db_: ?Sized + Database,
pub fn contents<'db, Db_>(self, db: &'db Db_) -> &'db Result<String, String>where
Db_: ?Sized + Database,
pub fn set_url<'db, Db_>(
self,
db: &'db mut Db_,
) -> impl Setter<FieldTy = Url> + 'dbwhere
Db_: ?Sized + Database,
pub fn set_contents<'db, Db_>(
self,
db: &'db mut Db_,
) -> impl Setter<FieldTy = Result<String, String>> + 'dbwhere
Db_: ?Sized + Database,
Source§impl SourceFile
impl SourceFile
Sourcepub fn contents_if_ok(self, db: &dyn Db) -> &str
pub fn contents_if_ok(self, db: &dyn Db) -> &str
Returns the contents of this file or an empty string if it couldn’t be read.
Sourcepub fn absolute_span(self, db: &dyn Db) -> AbsoluteSpan
pub fn absolute_span(self, db: &dyn Db) -> AbsoluteSpan
Returns an absolute span representing the entire source file.
pub fn module_name(self, db: &dyn Db) -> Identifier<'_>
pub fn url_display(self, db: &dyn Db) -> String
Sourcepub fn line_starts(self: SourceFile, db: &dyn Db) -> &Vec<AbsoluteOffset>
pub fn line_starts(self: SourceFile, db: &dyn Db) -> &Vec<AbsoluteOffset>
A vector containing the start indices of each (0-based) line plus one final entry with the total document length (effectively an imaginary N+1 line that starts, and ends, at the end).
pub fn line_range(self, db: &dyn Db, line: ZeroLine) -> Range<AbsoluteOffset>
pub fn line_col( self, db: &dyn Db, offset: AbsoluteOffset, ) -> (ZeroLine, ZeroColumn)
Trait Implementations§
Source§impl Clone for SourceFile
impl Clone for SourceFile
Source§fn clone(&self) -> SourceFile
fn clone(&self) -> SourceFile
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 Configuration for SourceFile
impl Configuration for SourceFile
Source§type Struct = SourceFile
type Struct = SourceFile
The input struct (which wraps an Id)
Source§type Fields = (Url, Result<String, String>)
type Fields = (Url, Result<String, String>)
A (possibly empty) tuple of the fields for this struct.
Source§type Stamps = Array<StampedValue<()>, 2>
type Stamps = Array<StampedValue<()>, 2>
A array of StampedValue<()> tuples, one per each of the value fields.
const DEBUG_NAME: &'static str = "SourceFile"
const FIELD_DEBUG_NAMES: &'static [&'static str]
Source§impl Debug for SourceFile
impl Debug for SourceFile
Source§impl<'db> From<SourceFile> for Anchor<'db>
impl<'db> From<SourceFile> for Anchor<'db>
Source§fn from(value: SourceFile) -> Self
fn from(value: SourceFile) -> Self
Converts to this type from the input type.
Source§impl<'db> From<SourceFile> for AstItem<'db>
impl<'db> From<SourceFile> for AstItem<'db>
Source§fn from(value: SourceFile) -> Self
fn from(value: SourceFile) -> Self
Converts to this type from the input type.
Source§impl Hash for SourceFile
impl Hash for SourceFile
Source§impl Ord for SourceFile
impl Ord for SourceFile
Source§fn cmp(&self, other: &SourceFile) -> Ordering
fn cmp(&self, other: &SourceFile) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SourceFile
impl PartialEq for SourceFile
Source§impl PartialOrd for SourceFile
impl PartialOrd for SourceFile
Source§impl SalsaStructInDb for SourceFile
impl SalsaStructInDb for SourceFile
Source§impl Serialize for SourceFile
impl Serialize for SourceFile
Source§impl Update for SourceFile
impl Update for SourceFile
impl Copy for SourceFile
impl Eq for SourceFile
impl StructuralPartialEq for SourceFile
Auto Trait Implementations§
impl Freeze for SourceFile
impl RefUnwindSafe for SourceFile
impl Send for SourceFile
impl Sync for SourceFile
impl Unpin for SourceFile
impl UnsafeUnpin for SourceFile
impl UnwindSafe for SourceFile
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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