mirror of
				https://github.com/johrpan/musicus.git
				synced 2025-10-26 19:57:25 +01:00 
			
		
		
		
	Split into multiple crates
This commit is contained in:
		
							parent
							
								
									d7fb996183
								
							
						
					
					
						commit
						5d06ec9faf
					
				
					 88 changed files with 501 additions and 528 deletions
				
			
		
							
								
								
									
										17
									
								
								crates/musicus_client/src/ensembles.rs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								crates/musicus_client/src/ensembles.rs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| use crate::{Client, Result}; | ||||
| use musicus_database::Ensemble; | ||||
| 
 | ||||
| impl Client { | ||||
|     /// Get all available ensembles from the server.
 | ||||
|     pub async fn get_ensembles(&self) -> Result<Vec<Ensemble>> { | ||||
|         let body = self.get("ensembles").await?; | ||||
|         let ensembles: Vec<Ensemble> = serde_json::from_str(&body)?; | ||||
|         Ok(ensembles) | ||||
|     } | ||||
| 
 | ||||
|     /// Post a new ensemble to the server.
 | ||||
|     pub async fn post_ensemble(&self, data: &Ensemble) -> Result<()> { | ||||
|         self.post("ensembles", serde_json::to_string(data)?).await?; | ||||
|         Ok(()) | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Elias Projahn
						Elias Projahn