pub struct Builder { /* private fields */ }
Expand description
Compress/decompress with specific options
Use the builder class to compress and decompress using specific options.
If you’re not sure about the options, either use Builder::default or use the convenience functions Engine::compress and Engine::decompress
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn set_custom(&mut self, list: Vec<&'static str>) -> &mut Self
pub fn set_custom(&mut self, list: Vec<&'static str>) -> &mut Self
Move in a new list of custom words
sss supports the use of 32 custom strings which are encoded as two bytes. This list can be replaced completely with this Builder::set_custom function, or it can be modified with the Builder::push_custom or Builder::clear_custom functions.
Note: The protocol only supports 32 custom strings, so only the first 32 strings will be used in the custom vector. Adding more than 32 is not an error, but these extra strings will not be used.
Sourcepub fn set_custom_spaces(&mut self, spaces: bool) -> &mut Self
pub fn set_custom_spaces(&mut self, spaces: bool) -> &mut Self
Determines whether the custom words will automatically support space prefixes.
If true, the maximum number of possible custom strings in the table is halved from 32 to 16.
Sourcepub fn push_custom(&mut self, custom: &'static str) -> &mut Self
pub fn push_custom(&mut self, custom: &'static str) -> &mut Self
Appends a single string to the custom list. See the Builder::set_custom for more information on custom strings.
Sourcepub fn clear_custom(&mut self) -> &mut Self
pub fn clear_custom(&mut self) -> &mut Self
Clears the custom list. See the Builder::set_custom for more information on custom strings.
Sourcepub fn len_custom(&self) -> usize
pub fn len_custom(&self) -> usize
Returns the current length of the custom string list