Sections — Documentation by YARD 0.9.37 (original) (raw)

Module: Mongo::Protocol::Serializers::SectionsPrivate

Defined in:

lib/mongo/protocol/serializers.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

MongoDB wire protocol serialization strategy for a Section of OP_MSG.

Serializes and de-serializes a list of Sections.

Defined Under Namespace

Modules: PayloadOne, PayloadZero

Class Method Summarycollapse

Class Method Details

.deserialize(buffer, options = {}) ⇒ ArrayBSON::Document

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deserializes a section of an OP_MSG from the IO stream.

.serialize(buffer, value, max_bson_size = nil, validating_keys = nil) ⇒ BSON::ByteBuffer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Serializes the sections of an OP_MSG, payload type 0 or 1.

| 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | # File 'lib/mongo/protocol/serializers.rb', line 192 def self.serialize(buffer, value, max_bson_size = nil, validating_keys = nil) value.each do |section| case section[:type] when PayloadZero::TYPE PayloadZero.serialize(buffer, section[:payload], max_bson_size) when nil PayloadZero.serialize(buffer, section[:payload], max_bson_size) when PayloadOne::TYPE PayloadOne.serialize(buffer, section[:payload], max_bson_size) else raise Error::UnknownPayloadType.new(section[:type]) end end end | | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

.size_limited? ⇒ true

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Whether there can be a size limit on this type after serialization.

240 241 242 # File 'lib/mongo/protocol/serializers.rb', line 240 def self.size_limited? true end