Class: VibeZstd::CDict

Inherits:
Object
  • Object
show all
Defined in:
lib/vibe_zstd.rb,
sig/vibe_zstd.rbs,
ext/vibe_zstd/vibe_zstd.c

Overview

Pre-digested compression dictionary

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCDict

Returns a new instance of CDict.

Parameters:

  • dict_data (String)
  • level (Integer, nil)


29
# File 'sig/vibe_zstd.rbs', line 29

def initialize: (String dict_data, ?Integer? level) -> void

Class Method Details

.estimate_memory(dict_size, level) ⇒ Object

CDict.estimate_memory(dict_size, level)



607
# File 'ext/vibe_zstd/dict.c', line 607

def self.estimate_memory: (Integer dict_size, Integer level) -> Integer

Instance Method Details

#dict_idObject

CDict dict_id method - returns dictionary ID



59
# File 'ext/vibe_zstd/dict.c', line 59

def dict_id: () -> Integer

#sizeObject

CDict size method - returns the size in memory



47
# File 'ext/vibe_zstd/dict.c', line 47

def size: () -> Integer

#to_ddictDDict Also known as: ddict

Get or create a matching DDict from this CDict's dictionary data The DDict is cached so it's only created once

Returns:

  • (DDict)

    Decompression dictionary matching this compression dictionary



81
82
83
# File 'lib/vibe_zstd.rb', line 81

def to_ddict
  @ddict ||= DDict.new(@dict_data)
end