SynchronizedStorage

extension MoEngageStorage.SynchronizedStorage: MoEngageStorage.ReadOnlyLocation
where Location: MoEngageStorage.ReadOnlyLocation
extension MoEngageStorage.SynchronizedStorage: MoEngageStorage.WriteOnlyLocation
where Location: MoEngageStorage.WriteOnlyLocation
extension MoEngageStorage.SynchronizedStorage: MoEngageStorage.MigratableLocation
where Location: MoEngageStorage.MigratableLocation
extension MoEngageStorage.SynchronizedStorage: Equatable where Location: Equatable
extension MoEngageStorage.SynchronizedStorage: Hashable where Location: Hashable

Available where Location: MoEngageStorage.ReadOnlyLocation

  • Reads the wrapped location’s value inside the synchronisation lock.

    Declaration

    Swift

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

    Parameters

    input

    Unused (Void).

    sdkInstance

    The isolated SDK instance to read from.

    Return Value

    The stored value.

Available where Location: MoEngageStorage.WriteOnlyLocation

  • Writes to the wrapped location inside the synchronisation lock.

    Declaration

    Swift

    public func write(
        _ value: Location.Saved,
        toInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    ) throws(Location.WriteError) -> Location.Output

    Parameters

    value

    The value to persist.

    sdkInstance

    The isolated SDK instance to write to.

Available where Location: MoEngageStorage.MigratableLocation

  • Removes from the wrapped location inside the synchronisation lock.

    Declaration

    Swift

    public func remove(
        fromInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    ) throws(Location.RemoveError) -> Location.RemoveOutput

    Parameters

    sdkInstance

    The isolated SDK instance to remove from.