// Auto generated dependencies // If you find issues with the dependencies, please // 1. Delete all code after this comment // 2. Clear the auto generated part in `policy/_policies/Cargo.toml` // 3. Run `cargo run --bin butckrepo-refresh` in the Butchunker root directory pub mod error; pub mod stream_read; use error::ChunkFailed; use std::{collections::HashMap, path::Path}; use crate::stream_read::chunk_stream_process; /// Chunks the specified raw data using the specified chunking policy /// /// # Parameters /// - `policy_name`: Chunking policy name, currently supports <<>> policies /// - `raw_data`: Raw data byte slice /// - `params`: Hashmap of parameters required by the chunking policy pub async fn chunk_with( policy_name: &str, raw_data: &[u8], params: &HashMap<&str, &str>, ) -> Result, ChunkFailed> { match policy_name { >>>>>>>>>> match_arms _ => Err(ChunkFailed::PolicyNotFound), } } pub async fn chunk_stream_with( policy_name: &str, size: u32, path: &Path, params: &HashMap<&str, &str>, ) -> Result, ChunkFailed> { match policy_name { >>>>>>>>>> match_arms_stream _ => Err(ChunkFailed::PolicyNotFound), } } pub fn policies() -> Vec<&'static str> { vec![ >>>>>>>>>> policy_names ] } >>>>>>>>>> exports_simple >>>>>>>>>> exports_stream >>>>>>>>>> exports_both @@@ >>> match_arms "<<>>" => Ok(<<>>::chunk(raw_data, params).await), @@@ <<< @@@ >>> match_arms_stream "<<>>" => { let mut stream = <<>>::default(); chunk_stream_process( path, &mut stream, size, params, async |current_data, len, stream, params| { <<>>::chunk_stream(current_data, len, stream, params).await }, ) .await } @@@ <<< @@@ >>> policy_names // <<>> "<<>>", @@@ <<< @@@ >>> exports_simple pub mod <<>> { use std::collections::HashMap; pub async fn chunk(raw_data: &[u8], params: &HashMap<&str, &str>) -> Vec { <<>>::<<>>(raw_data, params)<<>> } } @@@ <<< @@@ >>> exports_stream pub mod <<>> { pub use <<>>; pub async fn chunk_stream( current_data: &[u8], len: u32, stream: &mut <<>>, params: &std::collections::HashMap<&str, &str>, ) -> Option { <<>>::<<>>(current_data, len, stream, params)<<>> } } @@@ <<< @@@ >>> exports_both pub mod <<>> { pub use <<>>; use std::collections::HashMap; pub async fn chunk(raw_data: &[u8], params: &HashMap<&str, &str>) -> Vec { <<>>::<<>>(raw_data, params)<<>> } pub async fn chunk_stream( current_data: &[u8], len: u32, stream: &mut <<>>, params: &HashMap<&str, &str>, ) -> Option { <<>>::<<>>(current_data, len, stream, params)<<>> } } @@@ <<<