pub struct Repository {
pub service: String,
pub mount_target: String,
pub name: String,
pub url: String,
pub branch: String,
pub clone: bool,
}
Expand description
The struct for the repository.
Fields§
§service: String
The target service it will be mounted.
mount_target: String
The mount path the source code will be placed.
name: String
The name of the directory
url: String
The repository url.
branch: String
The branch to clone.
clone: bool
Tells the launcher where to clone the repository or not.
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn git_clone(
name: &String,
url: &String,
branch: &String,
services_dir: &String,
) -> String
pub fn git_clone( name: &String, url: &String, branch: &String, services_dir: &String, ) -> String
Clone a repository.
§Example
ⓘ
let data: Vec<Repository> = Vec::from([
Repository {
service: String::from("service"),
mount_target: String::from("/var/test"),
name: String::from("test"),
url: "https://github.com/j-p-d-e-v/embedded-rust-led-roulette".to_string(),
branch: "dev".to_string(),
clone: true
}
]);
for item in &data {
assert_eq!(!Repository::git_clone(&item.name,&item.url,&item.branch,&String::from("services")).len() > 0,true);
}
Trait Implementations§
Source§impl Debug for Repository
impl Debug for Repository
Source§impl<'de> Deserialize<'de> for Repository
impl<'de> Deserialize<'de> for Repository
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 Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnwindSafe for Repository
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