Table of Contents

Class FileProxy

Namespace
MarymoorStudios.Core.Promises.IO
Assembly
MarymoorStudios.Core.Promises.IO.dll
public sealed class FileProxy : Proxy<FileServer>, IProxy<FileProxy, FileServer>
Inheritance
FileProxy
Implements
Inherited Members
Extension Methods

Constructors

FileProxy(FileServer)

Creates a successfully resolved promise.

public FileProxy(FileServer value)

Parameters

value FileServer

FileProxy(Promise<FileServer>)

Creates a forwarded promise whose outcome will be the same as p.

public FileProxy(Promise<FileServer> p)

Parameters

p Promise<FileServer>

FileProxy(Resolver<FileServer>)

Creates an unresolved promise whose future outcome is defined by r.

public FileProxy(Resolver<FileServer> r)

Parameters

r Resolver<FileServer>

FileProxy(Proxy<FileServer>)

Creates a forwarded promise whose outcome will be the same as p.

public FileProxy(Proxy<FileServer> p)

Parameters

p Proxy<FileServer>

FileProxy(Exception)

Creates a failed promise whose outcome is ex.

public FileProxy(Exception ex)

Parameters

ex Exception

Methods

DisposeAsync()

public Promise DisposeAsync()

Returns

Promise

GetSize()

public Promise<long> GetSize()

Returns

Promise<long>

Read(ulong, int)

public Promise<OwnedMem<byte>> Read(ulong offset, int length = -1)

Parameters

offset ulong
length int

Returns

Promise<OwnedMem<byte>>

ReadBytes(ulong, long)

public Bytes ReadBytes(ulong offset = 0, long length = -1)

Parameters

offset ulong
length long

Returns

Bytes

Sync()

Sends a synchronization request to target of this proxy.

public override Promise Sync()

Returns

Promise

Resolves successfully if and only if this proxy itself has resolved successfully end-to-end (possibly remotely), otherwise resolves to the same failure that the proxy resolved to.

Remarks

Sync() is often used to prove successful initialization before pipelining methods on a proxy. Sync() determines if a (possibly remote) computation that produced the proxy succeeded or failed. The proxy may later become aborted (particularly if it is remote) , but at the moment in time when the Sync() completed the proxy was successfully connected.

Write(ReadOnlyMemory<byte>, ulong)

public Promise Write(ReadOnlyMemory<byte> buffer, ulong offset)

Parameters

buffer ReadOnlyMemory<byte>
offset ulong

Returns

Promise

WriteBytes(Bytes, ulong)

public Promise WriteBytes(Bytes content, ulong offset = 0)

Parameters

content Bytes
offset ulong

Returns

Promise

Operators

implicit operator FileProxy(Promise<FileProxy>)

Implicit conversion to its syntax.

public static implicit operator FileProxy(Promise<FileProxy> p)

Parameters

p Promise<FileProxy>

Returns

FileProxy

Explicit Interface Implementations

Create(FileServer)

Creates a successfully resolved promise.

static FileProxy Create(FileServer value)

Parameters

value FileServer

Returns

FileProxy

Create(Promise<FileServer>)

Creates a forwarded promise whose outcome will be the same as p.

static FileProxy Create(Promise<FileServer> p)

Parameters

p Promise<FileServer>

Returns

FileProxy

Create(Resolver<FileServer>)

Creates an unresolved promise whose future outcome is defined by r.

static FileProxy Create(Resolver<FileServer> r)

Parameters

r Resolver<FileServer>

Returns

FileProxy

Create(Proxy<FileServer>)

Creates a forwarded promise whose outcome will be the same as p.

static FileProxy Create(Proxy<FileServer> p)

Parameters

p Proxy<FileServer>

Returns

FileProxy

Create(Exception)

Creates a failed promise whose outcome is ex.

static FileProxy Create(Exception ex)

Parameters

ex Exception

Returns

FileProxy