Creates a new project on the remote (and pull it). # Arguments `name` - Project name `description` - Project description
(
&self,
name: N,
description: D,
)
| 348 | /// * `name` - Project name |
| 349 | /// * `description` - Project description |
| 350 | pub fn create_project<N: BnStrCompatible, D: BnStrCompatible>( |
| 351 | &self, |
| 352 | name: N, |
| 353 | description: D, |
| 354 | ) -> Result<Ref<RemoteProject>, ()> { |
| 355 | // TODO: Do we want this? |
| 356 | // TODO: If you have not yet pulled projects you will have never filled the map you will be placing your |
| 357 | // TODO: New project in. |
| 358 | if !self.has_pulled_projects() { |
| 359 | self.pull_projects()?; |
| 360 | } |
| 361 | let name = name.into_bytes_with_nul(); |
| 362 | let description = description.into_bytes_with_nul(); |
| 363 | let value = unsafe { |
| 364 | BNRemoteCreateProject( |
| 365 | self.handle.as_ptr(), |
| 366 | name.as_ref().as_ptr() as *const c_char, |
| 367 | description.as_ref().as_ptr() as *const c_char, |
| 368 | ) |
| 369 | }; |
| 370 | NonNull::new(value) |
| 371 | .map(|handle| unsafe { RemoteProject::ref_from_raw(handle) }) |
| 372 | .ok_or(()) |
| 373 | } |
| 374 | |
| 375 | /// Create a new project on the remote from a local project. |
| 376 | pub fn import_local_project(&self, project: &Project) -> Option<Ref<RemoteProject>> { |