pub struct File {
pub worktree: Model<Worktree>,
pub path: Arc<Path>,
pub mtime: SystemTime,
/* private fields */
}
Fields§
§worktree: Model<Worktree>
§path: Arc<Path>
§mtime: SystemTime
Implementations§
source§impl File
impl File
pub fn for_entry(entry: Entry, worktree: Model<Worktree>) -> Arc<Self>
pub fn from_proto( proto: File, worktree: Model<Worktree>, cx: &AppContext ) -> Result<Self>
pub fn from_dyn(file: Option<&Arc<dyn File>>) -> Option<&Self>
pub fn worktree_id(&self, cx: &AppContext) -> WorktreeId
pub fn project_entry_id(&self, _: &AppContext) -> Option<ProjectEntryId>
Trait Implementations§
source§impl File for File
impl File for File
source§fn file_name<'a>(&'a self, cx: &'a AppContext) -> &'a OsStr
fn file_name<'a>(&'a self, cx: &'a AppContext) -> &'a OsStr
Returns the last component of this handle’s absolute path. If this handle refers to the root of its worktree, then this method will return the name of the worktree itself.
fn as_local(&self) -> Option<&dyn LocalFile>
fn mtime(&self) -> SystemTime
source§fn path(&self) -> &Arc<Path>
fn path(&self) -> &Arc<Path>
Returns the path of this file relative to the worktree’s root directory.
source§fn full_path(&self, cx: &AppContext) -> PathBuf
fn full_path(&self, cx: &AppContext) -> PathBuf
Returns the path of this file relative to the worktree’s parent directory (this means it
includes the name of the worktree’s root folder).
source§fn worktree_id(&self) -> usize
fn worktree_id(&self) -> usize
Returns the id of the worktree to which this file belongs. Read more
fn is_deleted(&self) -> bool
fn as_any(&self) -> &dyn Any
fn to_proto(&self) -> File
fn is_local(&self) -> bool
source§impl LocalFile for File
impl LocalFile for File
source§fn abs_path(&self, cx: &AppContext) -> PathBuf
fn abs_path(&self, cx: &AppContext) -> PathBuf
Returns the absolute path of this file.
fn load(&self, cx: &AppContext) -> Task<Result<String>>
fn buffer_reloaded( &self, buffer_id: u64, version: &Global, fingerprint: RopeFingerprint, line_ending: LineEnding, mtime: SystemTime, cx: &mut AppContext )
source§impl PartialEq<File> for File
impl PartialEq<File> for File
impl StructuralPartialEq for File
Auto Trait Implementations§
impl !RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl !UnwindSafe for File
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