Show / Hide Table of Contents

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
Implements
IMessage<Struct>
IMessage
System.IEquatable<Struct>
IDeepCloneable<Struct>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Protobuf.WellKnownTypes
Assembly: Google.Protobuf.dll
Syntax
public sealed class Struct : IMessage<Struct>, IMessage, IEquatable<Struct>, IDeepCloneable<Struct>

Constructors

Struct()

Declaration
public Struct()

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
Type Description
MessageDescriptor

Fields

Unordered map of dynamically typed values.

Declaration
public MapField<string, Value> Fields { get; }
Property Value
Type Description
MapField<System.String, Value>

Parser

Declaration
public static MessageParser<Struct> Parser { get; }
Property Value
Type Description
MessageParser<Struct>

Methods

CalculateSize()

Declaration
public int CalculateSize()
Returns
Type Description
System.Int32
Implements
IMessage.CalculateSize()

Clone()

Declaration
public Struct Clone()
Returns
Type Description
Struct
Implements
IDeepCloneable<T>.Clone()

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()

MergeFrom(CodedInputStream)

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Implements
IMessage.MergeFrom(CodedInputStream)

MergeFrom(Struct)

Declaration
public void MergeFrom(Struct other)
Parameters
Type Name Description
Struct other
Implements
IMessage<T>.MergeFrom(T)

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

WriteTo(CodedOutputStream)

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output
Implements
IMessage.WriteTo(CodedOutputStream)

Explicit Interface Implementations

IMessage.Descriptor

Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Type Description
MessageDescriptor
Implements
IMessage.Descriptor

Extension Methods

MessageExtensions.MergeFrom(IMessage, Byte[])
MessageExtensions.MergeFrom(IMessage, Byte[], Int32, Int32)
MessageExtensions.MergeFrom(IMessage, ByteString)
MessageExtensions.MergeFrom(IMessage, Stream)
MessageExtensions.MergeDelimitedFrom(IMessage, Stream)
MessageExtensions.ToByteArray(IMessage)
MessageExtensions.WriteTo(IMessage, Stream)
MessageExtensions.WriteDelimitedTo(IMessage, Stream)
MessageExtensions.ToByteString(IMessage)
MessageExtensions.IsInitialized(IMessage)
Back to top