public static RdList <V> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <V> readValue, CtxWriteDelegate <V> writeValue) { var nextVersion = reader.ReadLong(); var id = reader.ReadRdId(); return(new RdList <V>(readValue, writeValue, nextVersion).WithId(id)); }
public static RdEndpoint <TReq, TRes> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <TReq> readRequest, CtxWriteDelegate <TReq> writeRequest, CtxReadDelegate <TRes> readResponse, CtxWriteDelegate <TRes> writeResponse) { var id = reader.ReadRdId(); return(new RdEndpoint <TReq, TRes>(readRequest, writeRequest, readResponse, writeResponse).WithId(id)); // throw new InvalidOperationException("Deserialization of RdEndpoint is not allowed, the only valid option is to create RdEndpoint with constructor."); }
public static RdProperty <T> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <T> readValue, CtxWriteDelegate <T> writeValue) { var id = reader.ReadRdId(); var res = new RdProperty <T>(readValue, writeValue).WithId(id); if (reader.ReadBool()) { res.myProperty.Value = readValue(ctx, reader); } return(res); }
public static RdSet <T> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <T> readValue, CtxWriteDelegate <T> writeValue) { var id = reader.ReadRdId(); return(new RdSet <T>(readValue, writeValue).WithId(id)); }
public static RdMap <K, V> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <K> readKey, CtxWriteDelegate <K> writeKey, CtxReadDelegate <V> readValue, CtxWriteDelegate <V> writeValue) { var id = reader.ReadRdId(); return(new RdMap <K, V>(readKey, writeKey, readValue, writeValue).WithId(id)); }
public static RdCall <TReq, TRes> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <TReq> readRequest, CtxWriteDelegate <TReq> writeRequest, CtxReadDelegate <TRes> readResponse, CtxWriteDelegate <TRes> writeResponse) { return(new RdCall <TReq, TRes>(readRequest, writeRequest, readResponse, writeResponse).WithId(reader.ReadRdId())); }