MappingStorage
extension MoEngageStorage.MappingStorage: MoEngageStorage.ReadOnlyLocation
where Location: MoEngageStorage.ReadOnlyLocation, Location.Stored == MappingFrom
extension MoEngageStorage.MappingStorage: MoEngageStorage.WriteOnlyLocation
where Location: MoEngageStorage.WriteOnlyLocation, Location.Saved == MappingTo
extension MoEngageStorage.MappingStorage: MoEngageStorage.MigratableLocation
where Location: MoEngageStorage.MigratableLocation
-
Reads the raw stored value and converts it to
ValueusingfromAction.Declaration
Swift
public func read( withInput input: Location.Input, fromInstance sdkInstance: isolated MoEngageSDKInstance = #isolation ) throws(Location.ReadError) -> ValueParameters
inputUnused (
Void).sdkInstanceThe isolated SDK instance to read from.
Return Value
The mapped value.
-
Converts
valueto the raw stored type usingtoActionand writes it, providedwriteConditionreturnstrue.Declaration
Swift
public func write( _ value: Value, toInstance sdkInstance: isolated MoEngageSDKInstance = #isolation ) throws(Location.WriteError)Parameters
valueThe mapped value to persist.
sdkInstanceThe isolated SDK instance to write to.
-
Removes the raw value from the underlying location, provided
writeConditionreturnstrue.Declaration
Swift
public func remove( fromInstance sdkInstance: isolated MoEngageSDKInstance = #isolation ) throws(Location.RemoveError)Parameters
sdkInstanceThe isolated SDK instance to remove from.