RouterSource Struct
The (RouterSourceDict or RouterSourceEnum) union (https://w3c.github.io/ServiceWorker/#typedefdef-routersource).
public readonly struct RouterSource : IEquatable<RouterSource>- Implements
Properties
| Name | Description |
|---|---|
| Dictionary | Gets the value as a RouterSourceDict, or null when the union holds a RouterSourceKind. |
| Kind | Gets the value as a RouterSourceKind, or null when the union holds a RouterSourceDict. |
| Value | Gets the value of the union: a RouterSourceDict or a RouterSourceKind. |
Dictionary
ServiceWorkerRouter.csGets the value as a RouterSourceDict, or null when the union holds a RouterSourceKind.
public RouterSourceDict? Dictionary { get; }Property value
Gets the value as a RouterSourceKind, or null when the union holds a RouterSourceDict.
public RouterSourceKind? Kind { get; }Property value
Gets the value of the union: a RouterSourceDict or a RouterSourceKind.
public object Value { get; }Property value
Methods
| Name | Description |
|---|---|
| Equals(RouterSource) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| FromRouterSourceDict(RouterSourceDict) | Creates the union from a cache source. |
| FromRouterSourceKind(RouterSourceKind) | Creates the union from a kind of source. |
| GetHashCode() | Returns the hash code for this instance. |
Equals overloads
Equals(RouterSource)
ServiceWorkerRouter.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(RouterSource other)Parameters
otherRouterSource- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
ServiceWorkerRouter.csFromRouterSourceDict(RouterSourceDict)
ServiceWorkerRouter.csCreates the union from a cache source.
public static RouterSource FromRouterSourceDict(RouterSourceDict value)FromRouterSourceKind(RouterSourceKind)
ServiceWorkerRouter.csCreates the union from a kind of source.
public static RouterSource FromRouterSourceKind(RouterSourceKind value)GetHashCode()
ServiceWorkerRouter.csOperators
| Name | Description |
|---|---|
| operator ==(RouterSource, RouterSource) | Determines whether two unions are equal. |
| implicit operator RouterSource(RouterSourceDict) | Converts a cache source to the union. |
| implicit operator RouterSource(RouterSourceKind) | Converts a kind of source to the union. |
| operator !=(RouterSource, RouterSource) | Determines whether two unions are different. |
operator ==(RouterSource, RouterSource)
ServiceWorkerRouter.csDetermines whether two unions are equal.
public static bool operator ==(RouterSource left, RouterSource right)op_Implicit overloads
implicit operator RouterSource(RouterSourceDict)
ServiceWorkerRouter.csConverts a cache source to the union.
public static implicit operator RouterSource(RouterSourceDict value)implicit operator RouterSource(RouterSourceKind)
ServiceWorkerRouter.csConverts a kind of source to the union.
public static implicit operator RouterSource(RouterSourceKind value)operator !=(RouterSource, RouterSource)
ServiceWorkerRouter.csDetermines whether two unions are different.
public static bool operator !=(RouterSource left, RouterSource right)