| 1 | #![allow(unsafe_code)] |
| 2 | |
| 3 | use superrust-analyzer cargo lzzzz 2.0.0 lz4/stream/::superrust-analyzer cargo lzzzz 2.0.0 lz4/::{ |
| 4 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/, |
| 5 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::{LZ4DecStreamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4DecStream#, LZ4Streamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4Stream#}, |
| 6 | }; |
| 7 | use craterust-analyzer cargo lzzzz 2.0.0 crate/::{Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error#, ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#, Resultrust-analyzer cargo lzzzz 2.0.0 common/error/Result#}; |
| 8 | |
| 9 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{ |
| 10 | memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::{size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of()., MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#}, |
| 11 | osrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/::rawrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/::{c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, c_voidrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_void#}, |
| 12 | ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#, |
| 13 | ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut(). |
| 14 | }; |
| 15 | |
| 16 | #[allow(clippy::large_enum_variant)] |
| 17 | enum Streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream# { |
| 18 | Stackrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#Stack#(LZ4Streamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4Stream#), |
| 19 | Heaprust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#Heap#(NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<LZ4Streamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4Stream#>), |
| 20 | } |
| 21 | |
| 22 | pub struct CompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext# { |
| 23 | streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext#stream.: Streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#, |
| 24 | } |
| 25 | |
| 26 | unsafe impl Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# for CompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext# {} |
| 27 | |
| 28 | impl CompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext# { |
| 29 | pub fn newrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]new().() -> Resultrust-analyzer cargo lzzzz 2.0.0 common/error/Result#<Selfrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]> { |
| 30 | let mut stream = MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#::<LZ4Streamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4Stream#>::uninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]uninit().(); |
| 31 | unsafe { |
| 32 | let ptr = bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_initStreamrust-analyzer cargo lzzzz 2.0.0 LZ4_initStream().( |
| 33 | stream.as_mut_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]as_mut_ptr().() as *mut c_voidrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_void#, |
| 34 | size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<LZ4Streamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4Stream#>(), |
| 35 | ); |
| 36 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().ptr.is_nullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/mut_ptr/impl#[`*mut T`]is_null().() { |
| 37 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext] { |
| 38 | streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext#stream.: Streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#::Stackrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#Stack#(stream.assume_initrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]assume_init().()), |
| 39 | }); |
| 40 | } |
| 41 | NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]new().(bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_createStreamrust-analyzer cargo lzzzz 2.0.0 LZ4_createStream().()) |
| 42 | } |
| 43 | .ok_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or_else().(|| Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error#::newrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error]new().(ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#::InitializationFailedrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#InitializationFailed#)) |
| 44 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(|stream| Selfrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext] { |
| 45 | streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext#stream.: Streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#::Heaprust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#Heap#(stream), |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | fn get_ptrrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]get_ptr().(&mut self) -> *mut LZ4Streamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4Stream# { |
| 50 | match &mut self.streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext#stream. { |
| 51 | Streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#::Stackrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#Stack#(stream) => stream as *mut LZ4Streamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4Stream#, |
| 52 | Streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#::Heaprust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#Heap#(ptr) => ptr.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | pub fn nextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]next().(&mut self, src: &[u8], dst: *mut u8, dst_len: usize, acceleration: i32) -> usize { |
| 57 | unsafe { |
| 58 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_compress_fast_continuerust-analyzer cargo lzzzz 2.0.0 LZ4_compress_fast_continue().( |
| 59 | self.get_ptrrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]get_ptr().(), |
| 60 | src.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_ptr().() as *const c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, |
| 61 | dst as *mut c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, |
| 62 | src.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 63 | dst_len as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 64 | acceleration as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 65 | ) as usize |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | pub fn load_dictrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]load_dict().(&mut self, dict: &[u8]) { |
| 70 | unsafe { |
| 71 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_loadDictrust-analyzer cargo lzzzz 2.0.0 LZ4_loadDict().( |
| 72 | self.get_ptrrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]get_ptr().(), |
| 73 | dict.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_ptr().() as *const c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, |
| 74 | dict.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 75 | ); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | pub fn load_dict_slowrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]load_dict_slow().(&mut self, dict: &[u8]) { |
| 80 | unsafe { |
| 81 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_loadDictSlowrust-analyzer cargo lzzzz 2.0.0 LZ4_loadDictSlow().( |
| 82 | self.get_ptrrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]get_ptr().(), |
| 83 | dict.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_ptr().() as *const c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, |
| 84 | dict.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 85 | ); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | pub fn save_dictrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]save_dict().(&mut self, dict: &mut [u8]) { |
| 90 | unsafe { |
| 91 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_saveDictrust-analyzer cargo lzzzz 2.0.0 LZ4_saveDict().( |
| 92 | self.get_ptrrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]get_ptr().(), |
| 93 | dict.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_ptr().() as *mut c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, |
| 94 | dict.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 95 | ); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | pub fn attach_dictrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]attach_dict().(&mut self, dict_stream: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&mut CompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext#>) { |
| 100 | unsafe { |
| 101 | if dict_stream.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() { |
| 102 | // Note(sewer56): When detaching dictionary, we need to reset the stream state |
| 103 | // This behaviour is consistent with what the LZ4 library itself does internally. |
| 104 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_resetStream_fastrust-analyzer cargo lzzzz 2.0.0 LZ4_resetStream_fast().(self.get_ptrrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]get_ptr().()); |
| 105 | } |
| 106 | |
| 107 | let dict_ptr = dict_stream.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|ctx| ctx.get_ptrrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]get_ptr().()).unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or().(null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut().()); |
| 108 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_attach_dictionaryrust-analyzer cargo lzzzz 2.0.0 LZ4_attach_dictionary().(self.get_ptrrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext]get_ptr().(), dict_ptr); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | impl Droprust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/drop/Drop# for CompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext# { |
| 114 | fn droprust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[CompressionContext][Drop]drop().(&mut self) { |
| 115 | if let Streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#::Heaprust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/Stream#Heap#(mut ptr) = self.streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/CompressionContext#stream. { |
| 116 | unsafe { |
| 117 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_freeStreamrust-analyzer cargo lzzzz 2.0.0 LZ4_freeStream().(ptr.as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().()); |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | pub struct DecompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext# { |
| 124 | streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext#stream.: NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#<LZ4DecStreamrust-analyzer cargo lzzzz 2.0.0 lz4/binding/LZ4DecStream#>, |
| 125 | } |
| 126 | |
| 127 | unsafe impl Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# for DecompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext# {} |
| 128 | |
| 129 | impl DecompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext# { |
| 130 | pub fn newrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[DecompressionContext]new().() -> Resultrust-analyzer cargo lzzzz 2.0.0 common/error/Result#<Selfrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[DecompressionContext]> { |
| 131 | unsafe { |
| 132 | let ptr = NonNullrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/NonNull#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]new().(bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_createStreamDecoderust-analyzer cargo lzzzz 2.0.0 LZ4_createStreamDecode().()); |
| 133 | ptr.ok_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or_else().(|| Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error#::newrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error]new().(ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#::InitializationFailedrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#InitializationFailed#)) |
| 134 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(|stream| Selfrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[DecompressionContext] { streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext#stream. }) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | pub fn resetrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[DecompressionContext]reset().(&mut self, dict: &[u8]) -> Resultrust-analyzer cargo lzzzz 2.0.0 common/error/Result#<()> { |
| 139 | let result = unsafe { |
| 140 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_setStreamDecoderust-analyzer cargo lzzzz 2.0.0 LZ4_setStreamDecode().( |
| 141 | self.streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext#stream..as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 142 | dict.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_ptr().() as *const c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, |
| 143 | dict.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 144 | ) |
| 145 | }; |
| 146 | if result rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().1 { |
| 147 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 148 | } else { |
| 149 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error#::newrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error]new().(ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#::InitializationFailedrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#InitializationFailed#)) |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | pub fn decompressrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[DecompressionContext]decompress().(&mut self, src: &[u8], dst: *mut u8, dst_len: usize) -> Resultrust-analyzer cargo lzzzz 2.0.0 common/error/Result#<usize> { |
| 154 | let result = unsafe { |
| 155 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_decompress_safe_continuerust-analyzer cargo lzzzz 2.0.0 LZ4_decompress_safe_continue().( |
| 156 | self.streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext#stream..as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_ptr().(), |
| 157 | src.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_ptr().() as *const c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, |
| 158 | dst as *mut c_charrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_char#, |
| 159 | src.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 160 | dst_len as c_intrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/raw/c_int#, |
| 161 | ) |
| 162 | }; |
| 163 | if result rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 164 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error#::newrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error]new().(ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#::DecompressionFailedrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#DecompressionFailed#)) |
| 165 | } else { |
| 166 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(result as usize) |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | impl Droprust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/drop/Drop# for DecompressionContextrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext# { |
| 172 | fn droprust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/impl#[DecompressionContext][Drop]drop().(&mut self) { |
| 173 | unsafe { |
| 174 | bindingrust-analyzer cargo lzzzz 2.0.0 lz4/binding/::LZ4_freeStreamDecoderust-analyzer cargo lzzzz 2.0.0 LZ4_freeStreamDecode().(self.streamrust-analyzer cargo lzzzz 2.0.0 lz4/stream/api/DecompressionContext#stream..as_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/non_null/impl#[`NonNull<T>`]as_mut().()); |
| 175 | } |
| 176 | } |
| 177 | } |