Struct Traffic
Represents an amount each way: bytes, or a rate where a member says so.
public readonly record struct Traffic : IEquatable<Traffic>
- Implements
- Inherited Members
Constructors
Traffic()
Initializes a new instance of the Traffic structure, with nothing either way.
public Traffic()
Traffic(long, long)
Initializes a new instance of the Traffic structure.
public Traffic(long sent, long received)
Parameters
Properties
Received
Gets the amount received.
public long Received { get; init; }
Property Value
Sent
Gets the amount sent.
public long Sent { get; init; }
Property Value
Total
Gets the sum of both ways.
[JsonIgnore]
public long Total { get; }
Property Value
Operators
operator +(Traffic, Traffic)
Adds two amounts, each way.
public static Traffic operator +(Traffic traffic1, Traffic traffic2)
Parameters
Returns
- Traffic
The sum.
operator -(Traffic, Traffic)
Subtracts an amount from another, each way.
public static Traffic operator -(Traffic traffic1, Traffic traffic2)
Parameters
Returns
- Traffic
The difference, which may be negative.