pub struct Defaults {
pub id: i64,
pub collection_name: Option<String>,
pub remote_name: Option<String>,
pub current_branch_name: Option<String>,
pub default_committer_name: String,
pub default_committer_email: String,
}Fields§
§id: i64§collection_name: Option<String>§remote_name: Option<String>§current_branch_name: Option<String>§default_committer_name: String§default_committer_email: StringImplementations§
Source§impl Defaults
impl Defaults
pub fn select(conn: &Connection) -> DefaultsSelect<'_>
pub fn all(conn: &Connection) -> Result<Vec<Self>, ModelSelectError>
Source§impl Defaults
impl Defaults
Sourcepub fn set_default_remote(
conn: &ConfigConnection,
remote_name: Option<&str>,
) -> Result<(), RemoteError>
pub fn set_default_remote( conn: &ConfigConnection, remote_name: Option<&str>, ) -> Result<(), RemoteError>
Set the default remote by name
pub fn set_default_remote_compat( conn: &ConfigConnection, remote_name: Option<&str>, ) -> SQLResult<()>
Sourcepub fn get_default_remote(conn: &ConfigConnection) -> Option<String>
pub fn get_default_remote(conn: &ConfigConnection) -> Option<String>
Get the default remote name
Sourcepub fn get_default_remote_url(conn: &ConfigConnection) -> Option<String>
pub fn get_default_remote_url(conn: &ConfigConnection) -> Option<String>
Helper method to get the default remote URL by resolving the remote name
pub fn set_current_branch( conn: &ConfigConnection, branch_name: Option<&str>, ) -> SQLResult<()>
pub fn get_current_branch(conn: &ConfigConnection) -> Option<String>
pub fn set_default_committer_name( conn: &ConfigConnection, name: &str, ) -> SQLResult<()>
pub fn get_default_committer_name(conn: &ConfigConnection) -> String
pub fn set_default_committer_email( conn: &ConfigConnection, email: &str, ) -> SQLResult<()>
pub fn get_default_committer_email(conn: &ConfigConnection) -> String
Sourcepub fn get(conn: &ConfigConnection) -> Option<Defaults>
pub fn get(conn: &ConfigConnection) -> Option<Defaults>
Get the defaults record
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Defaults
impl<'de> Deserialize<'de> for Defaults
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Defaults
impl RefUnwindSafe for Defaults
impl Send for Defaults
impl Sync for Defaults
impl Unpin for Defaults
impl UnsafeUnpin for Defaults
impl UnwindSafe for Defaults
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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