From 0486f97c68858b6725c846cce79c6d6012128646 Mon Sep 17 00:00:00 2001 From: Lehonti Ramos <17771375+Lehonti@users.noreply.github.com> Date: Thu, 4 Jan 2024 20:57:38 +0100 Subject: [PATCH] `struct`s in `Akka.Streams` with exclusively read-only members were made `readonly` (#6941) * `struct`s with exclusively read-only members were made `readonly` * added API approvals --------- Co-authored-by: Lehonti Ramos Co-authored-by: Gregorius Soedharmo Co-authored-by: Aaron Stannard --- ...APISpec.ApproveStreams.DotNet.verified.txt | 41 ++++++++++++------- src/core/Akka.Streams/Dsl/Tcp.cs | 6 +-- src/core/Akka.Streams/IMaterializer.cs | 2 +- src/core/Akka.Streams/IO/IOResult.cs | 2 +- src/core/Akka.Streams/Implementation/FanIn.cs | 10 ++--- .../Akka.Streams/Implementation/FanOut.cs | 8 ++-- .../Fusing/ActorGraphInterpreter.cs | 22 +++++----- .../Implementation/IO/FilePublisher.cs | 2 +- .../Implementation/IO/InputStreamPublisher.cs | 2 +- .../Implementation/IO/InputStreamSinkStage.cs | 4 +- .../Implementation/IO/TcpStages.cs | 4 +- .../Akka.Streams/Implementation/Transfer.cs | 2 +- src/core/Akka.Streams/Stage/GraphStage.cs | 2 +- 13 files changed, 60 insertions(+), 47 deletions(-) diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveStreams.DotNet.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveStreams.DotNet.verified.txt index 0ef559953..e17b26a58 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveStreams.DotNet.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveStreams.DotNet.verified.txt @@ -784,6 +784,7 @@ namespace Akka.Streams public static Akka.Streams.IGraph, Akka.Streams.UniqueKillSwitch> Single() { } public static Akka.Streams.IGraph, Akka.Streams.UniqueKillSwitch> SingleBidi() { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct MaterializationContext { public readonly Akka.Streams.Attributes EffectiveAttributes; @@ -2361,6 +2362,7 @@ namespace Akka.Streams.Dsl { public Tcp() { } public override Akka.Streams.Dsl.TcpExt CreateExtension(Akka.Actor.ExtendedActorSystem system) { } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct IncomingConnection { public readonly Akka.Streams.Dsl.Flow Flow; @@ -2369,12 +2371,14 @@ namespace Akka.Streams.Dsl public IncomingConnection(System.Net.EndPoint localAddress, System.Net.EndPoint remoteAddress, Akka.Streams.Dsl.Flow flow) { } public TMat HandleWith(Akka.Streams.Dsl.Flow handler, Akka.Streams.IMaterializer materializer) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OutgoingConnection { public readonly System.Net.EndPoint LocalAddress; public readonly System.Net.EndPoint RemoteAddress; public OutgoingConnection(System.Net.EndPoint remoteAddress, System.Net.EndPoint localAddress) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct ServerBinding { public readonly System.Net.EndPoint LocalAddress; @@ -2753,6 +2757,7 @@ namespace Akka.Streams.IO public AbruptIOTerminationException(Akka.Streams.IO.IOResult ioResult, System.Exception cause) { } public Akka.Streams.IO.IOResult IoResult { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct IOResult { public readonly long Count; @@ -3034,23 +3039,27 @@ namespace Akka.Streams.Implementation public const byte Depleted = 4; public const byte Marked = 1; public const byte Pending = 2; + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OnComplete : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { public readonly int Id; public OnComplete(int id) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OnError : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { public readonly System.Exception Cause; public readonly int Id; public OnError(int id, System.Exception cause) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OnNext : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { public readonly object Element; public readonly int Id; public OnNext(int id, object element) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OnSubscribe : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { public readonly int Id; @@ -3080,6 +3089,7 @@ namespace Akka.Streams.Implementation public void PumpFinished() { } protected override bool Receive(object message) { } public void WaitForUpstream(int waitForUpstream) { } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct SubInput : Reactive.Streams.ISubscriber { public SubInput(Akka.Actor.IActorRef impl, int id) { } @@ -3092,22 +3102,26 @@ namespace Akka.Streams.Implementation [Akka.Annotations.InternalApiAttribute()] public class static FanOut { + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct ExposedPublishers : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { public readonly System.Collections.Immutable.ImmutableList> Publishers; public ExposedPublishers(System.Collections.Immutable.ImmutableList> publishers) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct SubstreamCancel : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { public readonly int Id; public SubstreamCancel(int id) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct SubstreamRequestMore : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { public readonly long Demand; public readonly int Id; public SubstreamRequestMore(int id, long demand) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct SubstreamSubscribePending : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { public readonly int Id; @@ -3820,6 +3834,7 @@ namespace Akka.Streams.Implementation public const string GraphStageLogicTimer = "GraphStageLogicTimer"; public static System.TimeSpan IdleTimeoutCheckInterval(System.TimeSpan timeout) { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct TransferPhase { public readonly System.Action Action; @@ -3910,19 +3925,19 @@ namespace Akka.Streams.Implementation.Fusing public static Akka.Actor.Props Props(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell) { } protected override bool Receive(object message) { } public Akka.Actor.IActorRef RegisterShell(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell) { } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct Abort : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public Abort(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct AsyncInput : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly object Event; public readonly System.Action Handler; public readonly Akka.Streams.Stage.GraphStageLogic Logic; public AsyncInput(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, Akka.Streams.Stage.GraphStageLogic logic, object @event, System.Action handler) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } public class BatchingActorInputBoundary : Akka.Streams.Implementation.Fusing.GraphInterpreter.UpstreamBoundaryStageLogic @@ -3958,77 +3973,76 @@ namespace Akka.Streams.Implementation.Fusing public void Request(long elements) { } public override string ToString() { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct Cancel : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly int Id; public Cancel(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, int id, System.Exception cause) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public System.Exception Cause { get; } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct ExposedPublisher : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly int Id; public readonly Akka.Streams.Implementation.IActorPublisher Publisher; public ExposedPublisher(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, int id, Akka.Streams.Implementation.IActorPublisher publisher) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } public interface IBoundaryEvent : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression { Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OnComplete : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly int Id; public OnComplete(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, int id) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OnError : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly System.Exception Cause; public readonly int Id; public OnError(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, int id, System.Exception cause) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OnNext : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly object Event; public readonly int Id; public OnNext(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, int id, object @event) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct OnSubscribe : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly int Id; public readonly Reactive.Streams.ISubscription Subscription; public OnSubscribe(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, int id, Reactive.Streams.ISubscription subscription) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct RequestMore : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly long Demand; public readonly int Id; public RequestMore(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, int id, long demand) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct Resume : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public Resume(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct SubscribePending : Akka.Actor.INoSerializationVerificationNeeded, Akka.Event.IDeadLetterSuppression, Akka.Streams.Implementation.Fusing.ActorGraphInterpreter.IBoundaryEvent { public readonly int Id; public SubscribePending(Akka.Streams.Implementation.Fusing.GraphInterpreterShell shell, int id) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Implementation.Fusing.GraphInterpreterShell Shell { get; } } } @@ -5074,12 +5088,11 @@ namespace Akka.Streams.Stage public virtual void OnUpstreamFailure(System.Exception e) { } public virtual void OnUpstreamFinish() { } } + [System.Runtime.CompilerServices.IsReadOnlyAttribute()] public struct LogicAndMaterializedValue : Akka.Streams.Stage.ILogicAndMaterializedValue { public LogicAndMaterializedValue(Akka.Streams.Stage.GraphStageLogic logic, TMaterialized materializedValue) { } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public Akka.Streams.Stage.GraphStageLogic Logic { get; } - [get: System.Runtime.CompilerServices.IsReadOnlyAttribute()] public TMaterialized MaterializedValue { get; } } public abstract class OutGraphStageLogic : Akka.Streams.Stage.GraphStageLogic, Akka.Streams.Stage.IOutHandler diff --git a/src/core/Akka.Streams/Dsl/Tcp.cs b/src/core/Akka.Streams/Dsl/Tcp.cs index 6f783781b..908fc975e 100644 --- a/src/core/Akka.Streams/Dsl/Tcp.cs +++ b/src/core/Akka.Streams/Dsl/Tcp.cs @@ -33,7 +33,7 @@ namespace Akka.Streams.Dsl /// /// Represents a successful TCP server binding. /// - public struct ServerBinding + public readonly struct ServerBinding { private readonly Func _unbindAction; @@ -63,7 +63,7 @@ namespace Akka.Streams.Dsl /// /// Represents an accepted incoming TCP connection. /// - public struct IncomingConnection + public readonly struct IncomingConnection { /// /// Initializes a new instance of the class. @@ -110,7 +110,7 @@ namespace Akka.Streams.Dsl /// /// Represents a prospective outgoing TCP connection. /// - public struct OutgoingConnection + public readonly struct OutgoingConnection { /// /// Initializes a new instance of the class. diff --git a/src/core/Akka.Streams/IMaterializer.cs b/src/core/Akka.Streams/IMaterializer.cs index 03f34f677..e88ab33e3 100644 --- a/src/core/Akka.Streams/IMaterializer.cs +++ b/src/core/Akka.Streams/IMaterializer.cs @@ -187,7 +187,7 @@ namespace Akka.Streams /// /// Context parameter to the create methods of sources and sinks. /// - public struct MaterializationContext + public readonly struct MaterializationContext { /// /// TBD diff --git a/src/core/Akka.Streams/IO/IOResult.cs b/src/core/Akka.Streams/IO/IOResult.cs index f68e542c1..ef68bbbac 100644 --- a/src/core/Akka.Streams/IO/IOResult.cs +++ b/src/core/Akka.Streams/IO/IOResult.cs @@ -14,7 +14,7 @@ namespace Akka.Streams.IO /// Holds a result of an IO operation. /// // ReSharper disable once InconsistentNaming - public struct IOResult + public readonly struct IOResult { private readonly Result _status; diff --git a/src/core/Akka.Streams/Implementation/FanIn.cs b/src/core/Akka.Streams/Implementation/FanIn.cs index 773bbe39b..58c695a84 100644 --- a/src/core/Akka.Streams/Implementation/FanIn.cs +++ b/src/core/Akka.Streams/Implementation/FanIn.cs @@ -425,7 +425,7 @@ namespace Akka.Streams.Implementation /// TBD /// [Serializable] - public struct OnError : INoSerializationVerificationNeeded, IDeadLetterSuppression + public readonly struct OnError : INoSerializationVerificationNeeded, IDeadLetterSuppression { /// /// TBD @@ -452,7 +452,7 @@ namespace Akka.Streams.Implementation /// TBD /// [Serializable] - public struct OnComplete : INoSerializationVerificationNeeded, IDeadLetterSuppression + public readonly struct OnComplete : INoSerializationVerificationNeeded, IDeadLetterSuppression { /// /// TBD @@ -473,7 +473,7 @@ namespace Akka.Streams.Implementation /// TBD /// [Serializable] - public struct OnNext : INoSerializationVerificationNeeded, IDeadLetterSuppression + public readonly struct OnNext : INoSerializationVerificationNeeded, IDeadLetterSuppression { /// /// TBD @@ -500,7 +500,7 @@ namespace Akka.Streams.Implementation /// TBD /// [Serializable] - public struct OnSubscribe : INoSerializationVerificationNeeded, IDeadLetterSuppression + public readonly struct OnSubscribe : INoSerializationVerificationNeeded, IDeadLetterSuppression { /// /// TBD @@ -557,7 +557,7 @@ namespace Akka.Streams.Implementation /// /// TBD /// - public struct SubInput : ISubscriber + public readonly struct SubInput : ISubscriber { private readonly IActorRef _impl; private readonly int _id; diff --git a/src/core/Akka.Streams/Implementation/FanOut.cs b/src/core/Akka.Streams/Implementation/FanOut.cs index e62a95e76..73c6d2f70 100644 --- a/src/core/Akka.Streams/Implementation/FanOut.cs +++ b/src/core/Akka.Streams/Implementation/FanOut.cs @@ -415,7 +415,7 @@ namespace Akka.Streams.Implementation /// TBD /// [Serializable] - public struct SubstreamRequestMore : INoSerializationVerificationNeeded, IDeadLetterSuppression + public readonly struct SubstreamRequestMore : INoSerializationVerificationNeeded, IDeadLetterSuppression { /// /// TBD @@ -442,7 +442,7 @@ namespace Akka.Streams.Implementation /// TBD /// [Serializable] - public struct SubstreamCancel : INoSerializationVerificationNeeded, IDeadLetterSuppression + public readonly struct SubstreamCancel : INoSerializationVerificationNeeded, IDeadLetterSuppression { /// /// TBD @@ -463,7 +463,7 @@ namespace Akka.Streams.Implementation /// TBD /// [Serializable] - public struct SubstreamSubscribePending : INoSerializationVerificationNeeded, IDeadLetterSuppression + public readonly struct SubstreamSubscribePending : INoSerializationVerificationNeeded, IDeadLetterSuppression { /// /// TBD @@ -519,7 +519,7 @@ namespace Akka.Streams.Implementation /// /// TBD [Serializable] - public struct ExposedPublishers : INoSerializationVerificationNeeded, IDeadLetterSuppression + public readonly struct ExposedPublishers : INoSerializationVerificationNeeded, IDeadLetterSuppression { /// /// TBD diff --git a/src/core/Akka.Streams/Implementation/Fusing/ActorGraphInterpreter.cs b/src/core/Akka.Streams/Implementation/Fusing/ActorGraphInterpreter.cs index 2aa1a7acf..dba48031d 100644 --- a/src/core/Akka.Streams/Implementation/Fusing/ActorGraphInterpreter.cs +++ b/src/core/Akka.Streams/Implementation/Fusing/ActorGraphInterpreter.cs @@ -454,7 +454,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct OnError : IBoundaryEvent + public readonly struct OnError : IBoundaryEvent { /// /// TBD @@ -486,7 +486,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct OnComplete : IBoundaryEvent + public readonly struct OnComplete : IBoundaryEvent { /// /// TBD @@ -512,7 +512,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct OnNext : IBoundaryEvent + public readonly struct OnNext : IBoundaryEvent { /// /// TBD @@ -544,7 +544,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct OnSubscribe : IBoundaryEvent + public readonly struct OnSubscribe : IBoundaryEvent { /// /// TBD @@ -576,7 +576,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct RequestMore : IBoundaryEvent + public readonly struct RequestMore : IBoundaryEvent { /// /// TBD @@ -608,7 +608,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct Cancel : IBoundaryEvent + public readonly struct Cancel : IBoundaryEvent { /// /// TBD @@ -639,7 +639,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct SubscribePending : IBoundaryEvent + public readonly struct SubscribePending : IBoundaryEvent { /// /// TBD @@ -665,7 +665,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct ExposedPublisher : IBoundaryEvent + public readonly struct ExposedPublisher : IBoundaryEvent { /// /// TBD @@ -697,7 +697,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct AsyncInput : IBoundaryEvent + public readonly struct AsyncInput : IBoundaryEvent { /// /// TBD @@ -736,7 +736,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct Resume : IBoundaryEvent + public readonly struct Resume : IBoundaryEvent { /// /// TBD @@ -753,7 +753,7 @@ namespace Akka.Streams.Implementation.Fusing /// /// TBD /// - public struct Abort : IBoundaryEvent + public readonly struct Abort : IBoundaryEvent { /// /// TBD diff --git a/src/core/Akka.Streams/Implementation/IO/FilePublisher.cs b/src/core/Akka.Streams/Implementation/IO/FilePublisher.cs index 16cbdd241..7c71b67be 100644 --- a/src/core/Akka.Streams/Implementation/IO/FilePublisher.cs +++ b/src/core/Akka.Streams/Implementation/IO/FilePublisher.cs @@ -61,7 +61,7 @@ namespace Akka.Streams.Implementation.IO .WithDeploy(Deploy.Local); } - private struct Continue : IDeadLetterSuppression + private readonly struct Continue : IDeadLetterSuppression { public static readonly Continue Instance = new(); } diff --git a/src/core/Akka.Streams/Implementation/IO/InputStreamPublisher.cs b/src/core/Akka.Streams/Implementation/IO/InputStreamPublisher.cs index 356945719..dc7363f02 100644 --- a/src/core/Akka.Streams/Implementation/IO/InputStreamPublisher.cs +++ b/src/core/Akka.Streams/Implementation/IO/InputStreamPublisher.cs @@ -39,7 +39,7 @@ namespace Akka.Streams.Implementation.IO return Actor.Props.Create(inputstream, completionSource, chunkSize).WithDeploy(Deploy.Local); } - private struct Continue : IDeadLetterSuppression + private readonly struct Continue : IDeadLetterSuppression { public static Continue Instance { get; } = new(); } diff --git a/src/core/Akka.Streams/Implementation/IO/InputStreamSinkStage.cs b/src/core/Akka.Streams/Implementation/IO/InputStreamSinkStage.cs index 428b13ded..ac9f0b4a0 100644 --- a/src/core/Akka.Streams/Implementation/IO/InputStreamSinkStage.cs +++ b/src/core/Akka.Streams/Implementation/IO/InputStreamSinkStage.cs @@ -72,7 +72,7 @@ namespace Akka.Streams.Implementation.IO /// /// TBD /// - internal struct Data : IStreamToAdapterMessage + internal readonly struct Data : IStreamToAdapterMessage { /// /// TBD @@ -124,7 +124,7 @@ namespace Akka.Streams.Implementation.IO /// /// TBD /// - internal struct Failed : IStreamToAdapterMessage + internal readonly struct Failed : IStreamToAdapterMessage { /// /// TBD diff --git a/src/core/Akka.Streams/Implementation/IO/TcpStages.cs b/src/core/Akka.Streams/Implementation/IO/TcpStages.cs index 190e6526c..529424c72 100644 --- a/src/core/Akka.Streams/Implementation/IO/TcpStages.cs +++ b/src/core/Akka.Streams/Implementation/IO/TcpStages.cs @@ -335,7 +335,7 @@ namespace Akka.Streams.Implementation.IO /// /// TBD /// - internal struct Outbound : ITcpRole + internal readonly struct Outbound : ITcpRole { /// /// TBD @@ -376,7 +376,7 @@ namespace Akka.Streams.Implementation.IO /// /// TBD /// - internal struct Inbound : ITcpRole + internal readonly struct Inbound : ITcpRole { /// /// TBD diff --git a/src/core/Akka.Streams/Implementation/Transfer.cs b/src/core/Akka.Streams/Implementation/Transfer.cs index 6c58a8040..22f0b5789 100644 --- a/src/core/Akka.Streams/Implementation/Transfer.cs +++ b/src/core/Akka.Streams/Implementation/Transfer.cs @@ -362,7 +362,7 @@ namespace Akka.Streams.Implementation /// /// TBD /// - public struct TransferPhase + public readonly struct TransferPhase { /// /// TBD diff --git a/src/core/Akka.Streams/Stage/GraphStage.cs b/src/core/Akka.Streams/Stage/GraphStage.cs index e8ad1b3de..3f644e494 100644 --- a/src/core/Akka.Streams/Stage/GraphStage.cs +++ b/src/core/Akka.Streams/Stage/GraphStage.cs @@ -46,7 +46,7 @@ namespace Akka.Streams.Stage /// TBD /// /// TBD - public struct LogicAndMaterializedValue : ILogicAndMaterializedValue + public readonly struct LogicAndMaterializedValue : ILogicAndMaterializedValue { /// /// TBD