2 instantiations of IPNetwork
System.Net.Primitives (2)
System\Net\IPNetwork.cs (2)
210
result = new
IPNetwork
(address, prefixLength, false);
239
result = new
IPNetwork
(address, prefixLength, false);
55 references to IPNetwork
System.Net.Primitives (55)
System\Net\IPNetwork.cs (55)
24
public readonly struct IPNetwork : IEquatable<
IPNetwork
>, ISpanFormattable, ISpanParsable<
IPNetwork
>, IUtf8SpanFormattable, IUtf8SpanParsable<
IPNetwork
>
39
/// Initializes a new instance of the <see cref="
IPNetwork
"/> class with the specified <see cref="IPAddress"/> and prefix length.
129
/// Converts a CIDR <see cref="string"/> to an <see cref="
IPNetwork
"/> instance.
132
/// <returns>An <see cref="
IPNetwork
"/> instance.</returns>
135
public static
IPNetwork
Parse(string s)
142
/// Converts a CIDR character span to an <see cref="
IPNetwork
"/> instance.
145
/// <returns>An <see cref="
IPNetwork
"/> instance.</returns>
147
public static
IPNetwork
Parse(ReadOnlySpan<char> s)
149
if (!TryParse(s, out
IPNetwork
result))
158
/// Converts a UTF-8 CIDR character span to an <see cref="
IPNetwork
"/> instance.
161
/// <returns>An <see cref="
IPNetwork
"/> instance.</returns>
163
public static
IPNetwork
Parse(ReadOnlySpan<byte> utf8Text)
165
if (!TryParse(utf8Text, out
IPNetwork
result))
174
/// Converts the specified CIDR string to an <see cref="
IPNetwork
"/> instance and returns a value indicating whether the conversion succeeded.
177
/// <param name="result">When the method returns, contains an <see cref="
IPNetwork
"/> instance if the conversion succeeds.</param>
179
public static bool TryParse(string? s, out
IPNetwork
result)
191
/// Converts the specified CIDR character span to an <see cref="
IPNetwork
"/> instance and returns a value indicating whether the conversion succeeded.
194
/// <param name="result">When the method returns, contains an <see cref="
IPNetwork
"/> instance if the conversion succeeds.</param>
196
public static bool TryParse(ReadOnlySpan<char> s, out
IPNetwork
result)
220
/// Converts the specified UTF-8 CIDR character span to an <see cref="
IPNetwork
"/> instance and returns a value indicating whether the conversion succeeded.
223
/// <param name="result">When the method returns, contains an <see cref="
IPNetwork
"/> instance if the conversion succeeds.</param>
225
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out
IPNetwork
result)
284
/// Converts the instance to a string containing the <see cref="
IPNetwork
"/>'s CIDR notation.
286
/// <returns>The <see cref="string"/> containing the <see cref="
IPNetwork
"/>'s CIDR notation.</returns>
291
/// Attempts to write the <see cref="
IPNetwork
"/>'s CIDR notation to the given <paramref name="destination"/> span and returns a value indicating whether the operation succeeded.
300
/// Attempts to write the <see cref="
IPNetwork
"/>'s CIDR notation to the given <paramref name="utf8Destination"/> UTF-8 span and returns a value indicating whether the operation succeeded.
309
/// Determines whether two <see cref="
IPNetwork
"/> instances are equal.
311
/// <param name="other">The <see cref="
IPNetwork
"/> instance to compare to this instance.</param>
313
/// <exception cref="InvalidOperationException">Uninitialized <see cref="
IPNetwork
"/> instance.</exception>
314
public bool Equals(
IPNetwork
other) =>
319
/// Determines whether two <see cref="
IPNetwork
"/> instances are equal.
321
/// <param name="obj">The <see cref="
IPNetwork
"/> instance to compare to this instance.</param>
322
/// <returns><see langword="true"/> if <paramref name="obj"/> is an <see cref="
IPNetwork
"/> instance and the networks are equal; otherwise <see langword="false"/>.</returns>
323
/// <exception cref="InvalidOperationException">Uninitialized <see cref="
IPNetwork
"/> instance.</exception>
325
obj is
IPNetwork
other &&
329
/// Determines whether the specified instances of <see cref="
IPNetwork
"/> are equal.
334
public static bool operator ==(
IPNetwork
left,
IPNetwork
right) => left.Equals(right);
337
/// Determines whether the specified instances of <see cref="
IPNetwork
"/> are not equal.
342
public static bool operator !=(
IPNetwork
left,
IPNetwork
right) => !(left == right);
364
static
IPNetwork
IParsable<
IPNetwork
>.Parse([NotNull] string s, IFormatProvider? provider) => Parse(s);
367
static bool IParsable<
IPNetwork
>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out
IPNetwork
result) => TryParse(s, out result);
370
static
IPNetwork
ISpanParsable<
IPNetwork
>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s);
373
static
IPNetwork
IUtf8SpanParsable<
IPNetwork
>.Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text);
376
static bool ISpanParsable<
IPNetwork
>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
IPNetwork
result) => TryParse(s, out result);
379
static bool IUtf8SpanParsable<
IPNetwork
>.TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out
IPNetwork
result) => TryParse(utf8Text, out result);