@@ -40,7 +40,7 @@ namespace RabbitMQ.Client
40
40
/// <summary>
41
41
/// AMQP specification content header properties for content class "basic".
42
42
/// </summary>
43
- public struct BasicProperties : IBasicProperties , IAmqpHeader
43
+ public sealed class BasicProperties : IBasicProperties , IAmqpHeader
44
44
{
45
45
public string ? ContentType { get ; set ; }
46
46
public string ? ContentEncoding { get ; set ; }
@@ -59,7 +59,7 @@ public struct BasicProperties : IBasicProperties, IAmqpHeader
59
59
60
60
public bool Persistent
61
61
{
62
- readonly get
62
+ get
63
63
{
64
64
return DeliveryMode == DeliveryModes . Persistent ;
65
65
}
@@ -72,7 +72,7 @@ readonly get
72
72
73
73
public PublicationAddress ? ReplyToAddress
74
74
{
75
- readonly get
75
+ get
76
76
{
77
77
PublicationAddress . TryParse ( ReplyTo , out PublicationAddress result ) ;
78
78
return result ;
@@ -81,7 +81,11 @@ readonly get
81
81
set { ReplyTo = value ? . ToString ( ) ; }
82
82
}
83
83
84
- public BasicProperties ( in ReadOnlyBasicProperties input )
84
+ public BasicProperties ( )
85
+ {
86
+ }
87
+
88
+ public BasicProperties ( ReadOnlyBasicProperties input )
85
89
{
86
90
ContentType = input . ContentType ;
87
91
ContentEncoding = input . ContentEncoding ;
@@ -114,20 +118,20 @@ public BasicProperties(in ReadOnlyBasicProperties input)
114
118
public void ClearAppId ( ) => AppId = default ;
115
119
public void ClearClusterId ( ) => ClusterId = default ;
116
120
117
- public readonly bool IsContentTypePresent ( ) => ContentType != default ;
118
- public readonly bool IsContentEncodingPresent ( ) => ContentEncoding != default ;
119
- public readonly bool IsHeadersPresent ( ) => Headers != default ;
120
- public readonly bool IsDeliveryModePresent ( ) => DeliveryMode != default ;
121
- public readonly bool IsPriorityPresent ( ) => Priority != default ;
122
- public readonly bool IsCorrelationIdPresent ( ) => CorrelationId != default ;
123
- public readonly bool IsReplyToPresent ( ) => ReplyTo != default ;
124
- public readonly bool IsExpirationPresent ( ) => Expiration != default ;
125
- public readonly bool IsMessageIdPresent ( ) => MessageId != default ;
126
- public readonly bool IsTimestampPresent ( ) => Timestamp != default ;
127
- public readonly bool IsTypePresent ( ) => Type != default ;
128
- public readonly bool IsUserIdPresent ( ) => UserId != default ;
129
- public readonly bool IsAppIdPresent ( ) => AppId != default ;
130
- public readonly bool IsClusterIdPresent ( ) => ClusterId != default ;
121
+ public bool IsContentTypePresent ( ) => ContentType != default ;
122
+ public bool IsContentEncodingPresent ( ) => ContentEncoding != default ;
123
+ public bool IsHeadersPresent ( ) => Headers != default ;
124
+ public bool IsDeliveryModePresent ( ) => DeliveryMode != default ;
125
+ public bool IsPriorityPresent ( ) => Priority != default ;
126
+ public bool IsCorrelationIdPresent ( ) => CorrelationId != default ;
127
+ public bool IsReplyToPresent ( ) => ReplyTo != default ;
128
+ public bool IsExpirationPresent ( ) => Expiration != default ;
129
+ public bool IsMessageIdPresent ( ) => MessageId != default ;
130
+ public bool IsTimestampPresent ( ) => Timestamp != default ;
131
+ public bool IsTypePresent ( ) => Type != default ;
132
+ public bool IsUserIdPresent ( ) => UserId != default ;
133
+ public bool IsAppIdPresent ( ) => AppId != default ;
134
+ public bool IsClusterIdPresent ( ) => ClusterId != default ;
131
135
132
136
ushort IAmqpHeader . ProtocolClassId => ClassConstants . Basic ;
133
137
@@ -153,7 +157,7 @@ public BasicProperties(in ReadOnlyBasicProperties input)
153
157
internal const byte AppIdBit = 3 ;
154
158
internal const byte ClusterIdBit = 2 ;
155
159
156
- readonly int IAmqpWriteable . WriteTo ( Span < byte > span )
160
+ int IAmqpWriteable . WriteTo ( Span < byte > span )
157
161
{
158
162
int offset = 2 ;
159
163
ref byte bitValue = ref span . GetStart ( ) ;
@@ -247,7 +251,7 @@ readonly int IAmqpWriteable.WriteTo(Span<byte> span)
247
251
return offset ;
248
252
}
249
253
250
- readonly int IAmqpWriteable . GetRequiredBufferSize ( )
254
+ int IAmqpWriteable . GetRequiredBufferSize ( )
251
255
{
252
256
int bufferSize = 2 ; // number of presence fields (14) in 2 bytes blocks
253
257
if ( IsContentTypePresent ( ) ) { bufferSize += 1 + WireFormatting . GetByteCount ( ContentType ) ; } // _contentType in bytes
0 commit comments