mirror of
https://github.com/TxtDot/dalet-rs.git
synced 2025-03-13 19:24:38 +03:00
refactor: move traits to module
This commit is contained in:
parent
d79fbffa7a
commit
c121a53314
6 changed files with 150 additions and 149 deletions
|
@ -1,13 +1,13 @@
|
|||
use crate::daletl::{DlArgument, DlBody, DlTag, DlTid, IsNull, Page};
|
||||
use crate::daletl::{DlArgument, DlBody, DlPage, DlTag, DlTid, IsNull};
|
||||
|
||||
use super::{utils, DaletPackError, TypeId};
|
||||
|
||||
pub fn encode(page: &Page) -> Result<Vec<u8>, DaletPackError> {
|
||||
pub fn encode(page: &DlPage) -> Result<Vec<u8>, DaletPackError> {
|
||||
Ok(utils::compress_zstd(&encode_no_compress(page)?)
|
||||
.map_err(|_| DaletPackError::ZstdCompressError)?)
|
||||
}
|
||||
|
||||
pub fn encode_no_compress(page: &Page) -> Result<Vec<u8>, DaletPackError> {
|
||||
pub fn encode_no_compress(page: &DlPage) -> Result<Vec<u8>, DaletPackError> {
|
||||
if page.len() > 2usize.pow(32) {
|
||||
return Err(DaletPackError::PageMaxSizeExceeded);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue