AsyncDynamicStorage

extension MoEngageStorage.AsyncDynamicStorage: MoEngageStorage.AsyncReadOnlyLocation
where Base: MoEngageStorage.AsyncReadOnlyLocation, Base.Input == BaseInput
extension MoEngageStorage.AsyncDynamicStorage: MoEngageStorage.AsyncWriteOnlyLocation
where Base: MoEngageStorage.AsyncWriteOnlyLocation, Base.Saved == BaseInput

Available where Base: MoEngageStorage.AsyncReadOnlyLocation, Base.Input == BaseInput

  • Builds the location from input via factory, then awaits its read.

    Throws

    Base.ReadError propagated from the underlying location.

    Declaration

    Swift

    public func read(
        withInput input: Input,
        fromInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    ) async throws(Base.ReadError) -> Base.Stored

    Parameters

    input

    Forwarded to both factory and inputTransform.

    sdkInstance

    The isolated SDK instance passed to factory, inputTransform, and the resulting location’s read.

    Return Value

    The value stored at the location selected by factory.

Available where Base: MoEngageStorage.AsyncWriteOnlyLocation, Base.Saved == BaseInput

  • write(_:toInstance:) Asynchronous

    Builds the location from value.input via factory, then awaits its write with value.value.

    Throws

    Base.WriteError propagated from the underlying location.

    Declaration

    Swift

    @discardableResult
    public func write(
        _ value: Input,
        toInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    ) async throws(Base.WriteError) -> Base.Output

    Parameters

    value

    The composite value from which factory selects the location and whose value is the payload to save.

    sdkInstance

    The isolated SDK instance passed to factory and the resulting location’s write.