pub struct Sync<'a> { /* private fields */ }
Expand description
Sync helper for given store.
Implementations§
Source§impl<'a> Sync<'a>
impl<'a> Sync<'a>
Sourcepub fn readyness(&self) -> Result<Readyness>
pub fn readyness(&self) -> Result<Readyness>
Check readyness of store for syncing.
This checks whether the repository state is clean, which means that there’s no active
merge/rebase/etc.
The repository might be dirty, use sync_is_dirty
to check that.
Sourcepub fn prepare(&self) -> Result<()>
pub fn prepare(&self) -> Result<()>
Prepare the store for new changes.
- If sync is not initialized, it does nothing.
- If sync remote is set, it pulls changes.
Sourcepub fn finalize<M: AsRef<str>>(&self, msg: M) -> Result<()>
pub fn finalize<M: AsRef<str>>(&self, msg: M) -> Result<()>
Finalize the store with new changes.
- If sync is not initialized, it does nothing.
- If sync is initialized, it commits changes.
- If sync remote is set, it pushes changes.
Sourcepub fn tracked_remote_or_remotes(&self) -> Result<Vec<String>>
pub fn tracked_remote_or_remotes(&self) -> Result<Vec<String>>
Get a list of tracked remote or all sync remotes.
Sourcepub fn remote_url(&self, remote: &str) -> Result<String>
pub fn remote_url(&self, remote: &str) -> Result<String>
Get the URL of the given remote.
Sourcepub fn add_remote_url(&self, remote: &str, url: &str) -> Result<()>
pub fn add_remote_url(&self, remote: &str, url: &str) -> Result<()>
Add the URL of the given remote.
Sourcepub fn set_remote_url(&self, remote: &str, url: &str) -> Result<()>
pub fn set_remote_url(&self, remote: &str, url: &str) -> Result<()>
Set the URL of the given remote.
Sourcepub fn has_remote(&self) -> Result<bool>
pub fn has_remote(&self) -> Result<bool>
Check whether this store has a remote configured.
Sourcepub fn commit_all<M: AsRef<str>>(
&self,
msg: M,
commit_empty: bool,
) -> Result<()>
pub fn commit_all<M: AsRef<str>>( &self, msg: M, commit_empty: bool, ) -> Result<()>
Add all changes and commit them.
Sourcepub fn reset_hard_all(&self) -> Result<()>
pub fn reset_hard_all(&self) -> Result<()>
Hard reset all changes.
Sourcepub fn changed_files_raw(&self, short: bool) -> Result<String>
pub fn changed_files_raw(&self, short: bool) -> Result<String>
Get a list of changed files as raw output. This output is directly from git, is not processed, and is not stable.
If the list is empty, an empty string is returned.
Auto Trait Implementations§
impl<'a> Freeze for Sync<'a>
impl<'a> RefUnwindSafe for Sync<'a>
impl<'a> Send for Sync<'a>
impl<'a> Sync for Sync<'a>
impl<'a> Unpin for Sync<'a>
impl<'a> UnwindSafe for Sync<'a>
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
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 moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more