Struct StateRate

Namespace
MavNet.Core
Assembly
MavNet.Core.dll

How often a state-change subscriber wants to be called. Choose with the named factories — Raw, Hz(double), Every(TimeSpan) — rather than passing raw TimeSpan values, so call sites stay self-documenting.

Raw fires on every state-affecting packet (full fidelity, no throttling — appropriate for telemetry recorders, packet loggers, replay capture). Throttled rates fire at most once per MinInterval per subscriber.

public readonly struct StateRate : IEquatable<StateRate>
Implements
Inherited Members

Properties

IsRaw

true when no throttling is applied (equivalent to Raw).

public bool IsRaw { get; }

Property Value

bool

MinInterval

Minimum interval between successive deliveries. Zero = no throttling.

public TimeSpan MinInterval { get; }

Property Value

TimeSpan

Raw

Fire on every state-affecting packet — no throttling.

public static StateRate Raw { get; }

Property Value

StateRate

Methods

Equals(StateRate)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(StateRate other)

Parameters

other StateRate

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Every(TimeSpan)

At most one delivery per interval.

public static StateRate Every(TimeSpan interval)

Parameters

interval TimeSpan

Returns

StateRate

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Hz(double)

At most hz deliveries per second.

public static StateRate Hz(double hz)

Parameters

hz double

Returns

StateRate

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(StateRate, StateRate)

Returns true if both rates have the same MinInterval.

public static bool operator ==(StateRate a, StateRate b)

Parameters

a StateRate
b StateRate

Returns

bool

operator !=(StateRate, StateRate)

Returns true if the rates have different MinInterval values.

public static bool operator !=(StateRate a, StateRate b)

Parameters

a StateRate
b StateRate

Returns

bool