Class Struct
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
System.Object
Struct
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Google.Protobuf.dll
Syntax
public sealed class Struct : IMessage<Struct>, IMessage, IEquatable<Struct>, IDeepCloneable<Struct>
Constructors
Struct()
Declaration
Struct(Struct)
Declaration
public Struct(Struct other)
Parameters
Type |
Name |
Description |
Struct |
other |
|
Fields
FieldsFieldNumber
Field number for the "fields" field.
Declaration
public const int FieldsFieldNumber = 1
Field Value
Type |
Description |
System.Int32 |
|
Properties
Descriptor
Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Fields
Unordered map of dynamically typed values.
Declaration
public MapField<string, Value> Fields { get; }
Property Value
Parser
Declaration
public static MessageParser<Struct> Parser { get; }
Property Value
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
Clone()
Declaration
Returns
Implements
Equals(Struct)
Declaration
public bool Equals(Struct other)
Parameters
Type |
Name |
Description |
Struct |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<T>.Equals(T)
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
System.Object |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
MergeFrom(Struct)
Declaration
public void MergeFrom(Struct other)
Parameters
Type |
Name |
Description |
Struct |
other |
|
Implements
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
WriteTo(CodedOutputStream)
Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Implements
Explicit Interface Implementations
IMessage.Descriptor
Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Implements
Extension Methods