Struct ImageCacheMetadata
Represents the metadata associated with an image file.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Web
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public readonly struct ImageCacheMetadata : IEquatable<ImageCacheMetadata>
Constructors
| Improve this Doc View SourceImageCacheMetadata(DateTime, DateTime, String, TimeSpan, Int64)
Initializes a new instance of the ImageCacheMetadata struct.
Declaration
public ImageCacheMetadata(DateTime sourceLastWriteTimeUtc, DateTime cacheLastWriteTimeUtc, string contentType, TimeSpan cacheControlMaxAge, long contentLength)
Parameters
Type | Name | Description |
---|---|---|
DateTime | sourceLastWriteTimeUtc | The date and time in coordinated universal time (UTC) since the source file was last modified. |
DateTime | cacheLastWriteTimeUtc | The date and time in coordinated universal time (UTC) since the cache file was last modified. |
String | contentType | The content type for the source file. |
TimeSpan | cacheControlMaxAge | The maximum amount of time a resource will be considered fresh. |
Int64 | contentLength | The length of the image in bytes. |
Properties
| Improve this Doc View SourceCacheControlMaxAge
Gets the maximum amount of time a resource will be considered fresh.
Declaration
public readonly TimeSpan CacheControlMaxAge { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
CacheLastWriteTimeUtc
Gets the date and time in coordinated universal time (UTC) since the cached file was last modified.
Declaration
public readonly DateTime CacheLastWriteTimeUtc { get; }
Property Value
Type | Description |
---|---|
DateTime |
ContentLength
Gets the length of the image in bytes.
Declaration
public readonly long ContentLength { get; }
Property Value
Type | Description |
---|---|
Int64 |
ContentType
Gets the content type of the source file.
Declaration
public readonly string ContentType { get; }
Property Value
Type | Description |
---|---|
String |
SourceLastWriteTimeUtc
Gets the date and time in coordinated universal time (UTC) since the source file was last modified.
Declaration
public readonly DateTime SourceLastWriteTimeUtc { get; }
Property Value
Type | Description |
---|---|
DateTime |
Methods
| Improve this Doc View SourceEquals(ImageCacheMetadata)
Declaration
public readonly bool Equals(ImageCacheMetadata other)
Parameters
Type | Name | Description |
---|---|---|
ImageCacheMetadata | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceFromDictionary(IDictionary<String, String>)
Returns a new ImageCacheMetadata parsed from the given dictionary.
Declaration
public static ImageCacheMetadata FromDictionary(IDictionary<string, string> dictionary)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<String, String> | dictionary | The dictionary to parse and return the metadata from. |
Returns
Type | Description |
---|---|
ImageCacheMetadata | The ImageCacheMetadata. |
GetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceReadAsync(Stream)
Asynchronously reads and returns an ImageCacheMetadata from the input stream.
Declaration
public static async Task<ImageCacheMetadata> ReadAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The input stream. |
Returns
Type | Description |
---|---|
Task<ImageCacheMetadata> | The ImageCacheMetadata. |
ToDictionary()
Returns a new Dictionary<TKey,TValue> representing the current instance.
Declaration
public readonly Dictionary<string, string> ToDictionary()
Returns
Type | Description |
---|---|
Dictionary<String, String> |
ToString()
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
| Improve this Doc View SourceWriteAsync(Stream)
Asynchronously writes the metadata to the target stream.
Declaration
public readonly async Task WriteAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The target stream. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Operators
| Improve this Doc View SourceEquality(in ImageCacheMetadata, in ImageCacheMetadata)
Compares two ImageCacheMetadata objects for equality.
Declaration
public static bool operator ==(in ImageCacheMetadata left, in ImageCacheMetadata right)
Parameters
Type | Name | Description |
---|---|---|
ImageCacheMetadata | left | The ImageCacheMetadata on the left side of the operand. |
ImageCacheMetadata | right | The ImageCacheMetadata on the right side of the operand. |
Returns
Type | Description |
---|---|
Boolean | True if the current left is equal to the |
Inequality(in ImageCacheMetadata, in ImageCacheMetadata)
Compares two ImageCacheMetadata objects for inequality.
Declaration
public static bool operator !=(in ImageCacheMetadata left, in ImageCacheMetadata right)
Parameters
Type | Name | Description |
---|---|---|
ImageCacheMetadata | left | The ImageCacheMetadata on the left side of the operand. |
ImageCacheMetadata | right | The ImageCacheMetadata on the right side of the operand. |
Returns
Type | Description |
---|---|
Boolean | True if the current left is unequal to the |