public void TestFailing() { var deserializer = SerializedRW.collectionDeserializer( failingDeserializer, CollectionBuilderKnownSizeFactory <int> .immutableArray ); checkWithNoiseOpt(deserializer, serialized, Option <ImmutableArray <int> > .None); }
static PrefVal <ImmutableList <int> > create( ImmutableList <int> defaultVal, Deserialize <DeserializeInfo <int> > deserializeFn = null, PrefVal.OnDeserializeFailure onDeserializeFailure = PrefVal.OnDeserializeFailure.ReturnDefault ) => storage.collection( key, SerializedRW.lambda(serialize, deserializeFn ?? SerializedRW.integer.deserialize), convert, defaultVal, onDeserializeFailure: onDeserializeFailure, log: log );
public PrefVal <C> collection <A, C>( string key, ISerializedRW <A> rw, CollectionBuilderKnownSizeFactory <A, C> factory, C defaultVal, PrefVal.OnDeserializeFailure onDeserializeFailure = PrefVal.OnDeserializeFailure.ReturnDefault, ILog log = null ) where C : ICollection <A> { var collectionRw = SerializedRW.a( SerializedRW.collectionSerializer <A, C>(rw), SerializedRW.collectionDeserializer(rw, factory) ); return(collection <A, C>( key, collectionRw, defaultVal, onDeserializeFailure, log )); }
public PrefVal <C> collection <A, C>( string key, ISerializedRW <A> rw, Fn <ImmutableArray <A>, C> toCollection, C defaultVal, bool saveOnEveryWrite = true, PrefVal.OnDeserializeFailure onDeserializeFailure = PrefVal.OnDeserializeFailure.ReturnDefault, ILog log = null ) where C : ICollection <A> { var collectionRw = SerializedRW.a( SerializedRW.collectionSerializer <A, C>(rw), SerializedRW .collectionDeserializer(rw) .map(arr => toCollection(arr).some()) ); return(collection <A, C>( key, collectionRw, defaultVal, saveOnEveryWrite, onDeserializeFailure, log )); }
public void TestFailing() { var deserializer = SerializedRW.collectionDeserializer(failingDeserializer); checkWithNoiseOpt(deserializer, serialized, Option <ImmutableArray <int> > .None); }
public static IPrefValueRW<Option<A>> opt<A>( ISerializedRW<A> baRW, PrefVal.OnDeserializeFailure onDeserializeFailure = PrefVal.OnDeserializeFailure.ReturnDefault, ILog log = null ) => custom(SerializedRW.opt(baRW), onDeserializeFailure, log);