git.frostfs.info/TrueCloudLab/frostfs-sdk-go@v0.0.0-20241022124111-5361f0ecebd3/pool/tree/service/types_frostfs.pb.go (about)

     1  // Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
     2  
     3  package tree
     4  
     5  import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
     6  
     7  // StableSize returns the size of x in protobuf format.
     8  //
     9  // Structures with the same field values have the same binary size.
    10  func (x *KeyValue) StableSize() (size int) {
    11  	if x == nil {
    12  		return 0
    13  	}
    14  	size += proto.StringSize(1, x.Key)
    15  	size += proto.BytesSize(2, x.Value)
    16  	return size
    17  }
    18  
    19  // StableMarshal marshals x in protobuf binary format with stable field order.
    20  //
    21  // If buffer length is less than x.StableSize(), new buffer is allocated.
    22  //
    23  // Returns any error encountered which did not allow writing the data completely.
    24  // Otherwise, returns the buffer in which the data is written.
    25  //
    26  // Structures with the same field values have the same binary format.
    27  func (x *KeyValue) StableMarshal(buf []byte) []byte {
    28  	if x == nil {
    29  		return []byte{}
    30  	}
    31  	if buf == nil {
    32  		buf = make([]byte, x.StableSize())
    33  	}
    34  	var offset int
    35  	offset += proto.StringMarshal(1, buf[offset:], x.Key)
    36  	offset += proto.BytesMarshal(2, buf[offset:], x.Value)
    37  	return buf
    38  }
    39  
    40  // StableSize returns the size of x in protobuf format.
    41  //
    42  // Structures with the same field values have the same binary size.
    43  func (x *LogMove) StableSize() (size int) {
    44  	if x == nil {
    45  		return 0
    46  	}
    47  	size += proto.UInt64Size(1, x.ParentId)
    48  	size += proto.BytesSize(2, x.Meta)
    49  	size += proto.UInt64Size(3, x.ChildId)
    50  	return size
    51  }
    52  
    53  // StableMarshal marshals x in protobuf binary format with stable field order.
    54  //
    55  // If buffer length is less than x.StableSize(), new buffer is allocated.
    56  //
    57  // Returns any error encountered which did not allow writing the data completely.
    58  // Otherwise, returns the buffer in which the data is written.
    59  //
    60  // Structures with the same field values have the same binary format.
    61  func (x *LogMove) StableMarshal(buf []byte) []byte {
    62  	if x == nil {
    63  		return []byte{}
    64  	}
    65  	if buf == nil {
    66  		buf = make([]byte, x.StableSize())
    67  	}
    68  	var offset int
    69  	offset += proto.UInt64Marshal(1, buf[offset:], x.ParentId)
    70  	offset += proto.BytesMarshal(2, buf[offset:], x.Meta)
    71  	offset += proto.UInt64Marshal(3, buf[offset:], x.ChildId)
    72  	return buf
    73  }
    74  
    75  // StableSize returns the size of x in protobuf format.
    76  //
    77  // Structures with the same field values have the same binary size.
    78  func (x *Signature) StableSize() (size int) {
    79  	if x == nil {
    80  		return 0
    81  	}
    82  	size += proto.BytesSize(1, x.Key)
    83  	size += proto.BytesSize(2, x.Sign)
    84  	return size
    85  }
    86  
    87  // StableMarshal marshals x in protobuf binary format with stable field order.
    88  //
    89  // If buffer length is less than x.StableSize(), new buffer is allocated.
    90  //
    91  // Returns any error encountered which did not allow writing the data completely.
    92  // Otherwise, returns the buffer in which the data is written.
    93  //
    94  // Structures with the same field values have the same binary format.
    95  func (x *Signature) StableMarshal(buf []byte) []byte {
    96  	if x == nil {
    97  		return []byte{}
    98  	}
    99  	if buf == nil {
   100  		buf = make([]byte, x.StableSize())
   101  	}
   102  	var offset int
   103  	offset += proto.BytesMarshal(1, buf[offset:], x.Key)
   104  	offset += proto.BytesMarshal(2, buf[offset:], x.Sign)
   105  	return buf
   106  }