Class Struct (3.15.8)

public sealed class Struct : object, IMessage<Struct>, IEquatable<Struct>, IDeepCloneable<Struct>, IBufferMessage, IMessage

Struct represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, Struct might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.

The JSON representation for Struct is JSON object.

Inheritance

Object > Struct

Namespace

Google.Protobuf.WellKnownTypes

Assembly

Google.Protobuf.dll

Constructors

Struct()

public Struct()

Struct(Struct)

public Struct(Struct other)
Parameter
NameDescription
otherStruct

Fields

FieldsFieldNumber

public const int FieldsFieldNumber = null

Field number for the "fields" field.

Field Value
TypeDescription
Int32

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
TypeDescription
MessageDescriptor

Fields

public MapField<string, Value> Fields { get; }

Unordered map of dynamically typed values.

Property Value
TypeDescription
MapField<String, Value>

Parser

public static MessageParser<Struct> Parser { get; }
Property Value
TypeDescription
MessageParser<Struct>

Methods

CalculateSize()

public int CalculateSize()
Returns
TypeDescription
Int32

Clone()

public Struct Clone()
Returns
TypeDescription
Struct

Equals(Struct)

public bool Equals(Struct other)
Parameter
NameDescription
otherStruct
Returns
TypeDescription
Boolean

Equals(Object)

public override bool Equals(object other)
Parameter
NameDescription
otherObject
Returns
TypeDescription
Boolean

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
Int32

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream

MergeFrom(Struct)

public void MergeFrom(Struct other)
Parameter
NameDescription
otherStruct

ToString()

public override string ToString()
Returns
TypeDescription
String

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream

Explicit Interface Implementations

IBufferMessage.InternalMergeFrom(ref ParseContext)

void IBufferMessage.InternalMergeFrom(ref ParseContext input)
Parameter
NameDescription
inputParseContext

IBufferMessage.InternalWriteTo(ref WriteContext)

void IBufferMessage.InternalWriteTo(ref WriteContext output)
Parameter
NameDescription
outputWriteContext

IMessage.Descriptor

MessageDescriptor IMessage.Descriptor { get; }
Returns
TypeDescription
MessageDescriptor