comparison rust/hg-core/src/revlog/compression.rs @ 52305:f69a3f55fa9b

rust-compression: move the `Send` bound to the `Compressor` trait All compressors should be `Send`, might as well make any future use easier.
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 04 Nov 2024 13:43:36 +0100
parents 0744248cc541
children
comparison
equal deleted inserted replaced
52304:7756494c5ecd 52305:f69a3f55fa9b
139 } 139 }
140 } 140 }
141 141
142 /// A high-level trait to define compressors that should be able to compress 142 /// A high-level trait to define compressors that should be able to compress
143 /// and decompress arbitrary bytes. 143 /// and decompress arbitrary bytes.
144 pub trait Compressor { 144 pub trait Compressor: Send {
145 /// Returns a new [`Vec`] with the compressed data. 145 /// Returns a new [`Vec`] with the compressed data.
146 /// Should return `Ok(None)` if compression does not apply (e.g. too small) 146 /// Should return `Ok(None)` if compression does not apply (e.g. too small)
147 fn compress( 147 fn compress(
148 &mut self, 148 &mut self,
149 data: &[u8], 149 data: &[u8],