Struct text_editor::WorkTree[][src]

pub struct WorkTree { /* fields omitted */ }

Implementations

impl WorkTree[src]

pub fn new<G: 'static + GitProvider>(
    replica_id: ReplicaId,
    git: Rc<G>
) -> WorkTree
[src]

pub async fn reset(&self, head: [u8; 20]) -> Result<Vec<Operation>, Error>[src]

pub async fn apply_ops<I>(&self, ops: I) -> Result<Vec<Operation>, Error> where
    I: IntoIterator<Item = Operation> + 'static, 
[src]

pub fn version(&self) -> Global[src]

pub fn with_cursor<F>(&self, f: F) where
    F: FnMut(&mut Cursor<'_>), 
[src]

pub fn new_text_file(&self) -> (FileId, Operation)[src]

pub fn create_dir<P>(&self, path: P) -> Result<(FileId, Operation), Error> where
    P: AsRef<Path>, 
[src]

pub fn create_file<P>(
    &self,
    path: P,
    file_type: FileType
) -> Result<Operation, Error> where
    P: AsRef<Path>, 
[src]

pub async fn open_text_file<P>(&self, path: P) -> Result<BufferId, Error> where
    P: Into<PathBuf>, 
[src]

pub fn rename<P1, P2>(
    &self,
    old_path: P1,
    new_path: P2
) -> Result<Operation, Error> where
    P1: AsRef<Path>,
    P2: AsRef<Path>, 
[src]

pub fn remove<P>(&self, path: P) -> Result<Operation, Error> where
    P: AsRef<Path>, 
[src]

pub fn edit<I, T>(
    &self,
    buffer_id: BufferId,
    old_ranges: I,
    new_text: T
) -> Result<Operation, Error> where
    I: IntoIterator<Item = Range<usize>>,
    T: Into<Text>, 
[src]

pub fn edit_2d<I, T>(
    &self,
    buffer_id: BufferId,
    old_ranges: I,
    new_text: T
) -> Result<Operation, Error> where
    I: IntoIterator<Item = Range<Point>>,
    T: Into<Text>, 
[src]

pub fn path(&self, buffer_id: BufferId) -> Option<PathBuf>[src]

pub fn text(&self, buffer_id: BufferId) -> Result<Iter, Error>[src]

pub fn changes_since(
    &self,
    buffer_id: BufferId,
    version: Global
) -> Result<impl Iterator<Item = Change>, Error>
[src]

pub fn exists<P>(&self, path: P) -> bool where
    P: AsRef<Path>, 
[src]

pub fn head(&self) -> [u8; 20][src]

pub fn epoch_id(&self) -> Lamport[src]

Trait Implementations

impl Clone for WorkTree[src]

fn clone(&self) -> WorkTree[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

Auto Trait Implementations

impl !RefUnwindSafe for WorkTree

impl !Send for WorkTree

impl !Sync for WorkTree

impl Unpin for WorkTree

impl !UnwindSafe for WorkTree

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.