pub struct LocalSourceService {}Expand description
The LocalSourceService struct provides an implementation of the SourceService trait for initializing
and managing a project’s source files from the local machine.
Trait Implementations§
Source§impl Debug for LocalSourceService
impl Debug for LocalSourceService
Source§impl SourceService for LocalSourceService
impl SourceService for LocalSourceService
Source§fn initialize(
&self,
params: SourceInitializeParams,
initialized_repo: InitializedRepo,
) -> Result<InitializedSource, SkootError>
fn initialize( &self, params: SourceInitializeParams, initialized_repo: InitializedRepo, ) -> Result<InitializedSource, SkootError>
Returns Ok(()) if changes are committed and pushed back to the remote if successful,
otherwise returns an error.
Source§fn write_file<P: AsRef<Path>, C: AsRef<[u8]>>(
&self,
source: InitializedSource,
path: P,
name: String,
contents: C,
) -> Result<(), SkootError>
fn write_file<P: AsRef<Path>, C: AsRef<[u8]>>( &self, source: InitializedSource, path: P, name: String, contents: C, ) -> Result<(), SkootError>
Returns Ok(()) if a file is successfully written to some path within the source directory. Otherwise,
it returns an error.
Source§fn commit_and_push_changes(
&self,
source: InitializedSource,
message: String,
) -> Result<(), SkootError>
fn commit_and_push_changes( &self, source: InitializedSource, message: String, ) -> Result<(), SkootError>
Commits changes to the repo and pushed them to the remote. Read more
Source§fn read_file<P: AsRef<Path>>(
&self,
source: &InitializedSource,
path: P,
name: String,
) -> Result<String, SkootError>
fn read_file<P: AsRef<Path>>( &self, source: &InitializedSource, path: P, name: String, ) -> Result<String, SkootError>
Reads a file from the source code directory. Read more
Source§fn hash_file<P: AsRef<Path>>(
&self,
source: &InitializedSource,
path: P,
name: String,
) -> Result<String, SkootError>
fn hash_file<P: AsRef<Path>>( &self, source: &InitializedSource, path: P, name: String, ) -> Result<String, SkootError>
hash_file returns the SHA256 hash of a file. Read moreSource§fn pull_updates(&self, source: InitializedSource) -> Result<(), SkootError>
fn pull_updates(&self, source: InitializedSource) -> Result<(), SkootError>
Pulls updates from the remote repo. Read more
Auto Trait Implementations§
impl Freeze for LocalSourceService
impl RefUnwindSafe for LocalSourceService
impl Send for LocalSourceService
impl Sync for LocalSourceService
impl Unpin for LocalSourceService
impl UnwindSafe for LocalSourceService
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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