ErrorErasedStorage

extension MoEngageStorage.ErrorErasedStorage: MoEngageStorage.ReadOnlyLocation
extension MoEngageStorage.ErrorErasedStorage: MoEngageStorage.WriteOnlyLocation
extension MoEngageStorage.ErrorErasedStorage: MoEngageStorage.MigratableLocation
  • Reads using the captured closure, returning nil and logging on failure.

    Declaration

    Swift

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

    Parameters

    input

    Forwarded to the underlying read closure.

    sdkInstance

    The isolated SDK instance to read from.

    Return Value

    The stored value, or nil if the read threw an error.

WriteOnlyLocation

  • Writes using the captured closure, forwarding the result to the caller.

    Declaration

    Swift

    @discardableResult
    public func write(
        _ value: Saved,
        toInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    ) -> Output

    Parameters

    value

    The value to persist.

    sdkInstance

    The isolated SDK instance to write to.

    Return Value

    The output produced by the underlying write closure.

MigratableLocation

  • Removes using the captured closure, logging and absorbing any error.

    Declaration

    Swift

    public func remove(
        fromInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    )

    Parameters

    sdkInstance

    The isolated SDK instance to remove from.