feat(nix-compat): Add NixDeserialize and NixRead traits
Add a trait for deserializing a type from a daemon worker connection. This adds the NixDeserialize trait which is kind of like the serde Deserialize trait in that individual types are meant to implement it and it can potentially be derived in the future. The NixDeserialize trait takes something that implements NixRead as input so that you can among other things mock the reader. Change-Id: Ibb59e3562dfc822652f7d18039f00a1c0d422997 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11990 Autosubmit: Brian Olsen <me@griff.name> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									a774cb8c10
								
							
						
					
					
						commit
						9af6920478
					
				
					 22 changed files with 1499 additions and 166 deletions
				
			
		| 
						 | 
				
			
			@ -11,7 +11,7 @@ mod writer;
 | 
			
		|||
pub use writer::BytesWriter;
 | 
			
		||||
 | 
			
		||||
/// 8 null bytes, used to write out padding.
 | 
			
		||||
const EMPTY_BYTES: &[u8; 8] = &[0u8; 8];
 | 
			
		||||
pub(crate) const EMPTY_BYTES: &[u8; 8] = &[0u8; 8];
 | 
			
		||||
 | 
			
		||||
/// The length of the size field, in bytes is always 8.
 | 
			
		||||
const LEN_SIZE: usize = 8;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue