pub trait BoundaryGenerator {
// Required method
fn generate_boundary() -> String;
}
Expand description
A BoundaryGenerator
is a policy to generate a random string to use
as a part boundary.
The default generator will build a random string of 6 ascii characters.
If you need more complexity, you can implement this, and use it with
[Form::new
].
§Examples
use common_multipart_rfc7578::client::multipart::BoundaryGenerator;
struct TestGenerator;
impl BoundaryGenerator for TestGenerator {
fn generate_boundary() -> String {
"test".to_string()
}
}
Required Methods§
Sourcefn generate_boundary() -> String
fn generate_boundary() -> String
Generates a String to use as a boundary.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.