Struct final_compression::ParamSet
source · pub struct ParamSet { /* private fields */ }
Expand description
Represents parameter set for Compression
The ParamSet
can be obtained from String and &str
ParamSet string expression is “key1=value1;key2=value2;key3=value3” format
Internally it is a HashMap<String,, String>
Typical paramset used “level=3” (set compression level). See each compression algorithm for supported parameters
You can use “” as ParamSet and it won’t contain any actual parameter
Implementations§
source§impl ParamSet
impl ParamSet
sourcepub fn get_string<'a, 'b>(
&'a self,
key: &'b str,
default_value: &'b str
) -> &'b strwhere
'a: 'b,
pub fn get_string<'a, 'b>( &'a self, key: &'b str, default_value: &'b str ) -> &'b strwhere 'a: 'b,
Read parameter identified by key
as &str
. If not set, use the default_value
.
Trait Implementations§
source§impl From<String> for ParamSet
impl From<String> for ParamSet
Load ParamSet from String
source§fn from(what: String) -> Self
fn from(what: String) -> Self
what
must be “key=value;key1=value1” format. Empty tokens (e.g. “key=value;;;”) are skipped.
If you need to specify values that may contain special characters (e.g. include;
or =
), you can use
‘%%:’ to prefix your value, and the value should be url encoded.
For example format of `key=%%:%3B%3B%3B;key2=%%:%3B%3B%3B“ => key = “;;;”, key2 = “;;;”
What if your key should be “%%:123”?
No worries, “%%:123” => “%%:%25%25%3A123”