@@ -175,26 +175,27 @@ pub mod fs {
175
175
}
176
176
}
177
177
178
- pub struct FilePile < SealDef : RgbSealDef < Src = SealSrc > , SealSrc : RgbSealSrc >
179
- where <SealSrc :: PubWitness as PublishedWitness < SealSrc > >:: PubId :
178
+ pub struct FilePile < SealDef : RgbSealDef >
179
+ where << SealDef :: Src as SingleUseSeal > :: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId :
180
180
Copy + Ord + From < [ u8 ; 32 ] > + Into < [ u8 ; 32 ] >
181
181
{
182
182
hoard : FileAora <
183
- <SealSrc :: PubWitness as PublishedWitness < SealSrc > >:: PubId ,
184
- SealSrc :: CliWitness ,
183
+ << SealDef :: Src as SingleUseSeal > :: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId ,
184
+ < SealDef :: Src as SingleUseSeal > :: CliWitness ,
185
185
> ,
186
186
cache : FileAora <
187
- <SealSrc :: PubWitness as PublishedWitness < SealSrc > >:: PubId ,
188
- SealSrc :: PubWitness ,
187
+ << SealDef :: Src as SingleUseSeal > :: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId ,
188
+ < SealDef :: Src as SingleUseSeal > :: PubWitness ,
189
189
> ,
190
190
keep : FileAora < Opid , SmallOrdMap < u16 , SealDef > > ,
191
- index :
192
- FileIndex < <<SealSrc as SingleUseSeal >:: PubWitness as PublishedWitness < SealSrc > >:: PubId > ,
191
+ index : FileIndex <
192
+ <<SealDef :: Src as SingleUseSeal >:: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId ,
193
+ > ,
193
194
_phantom : PhantomData < SealDef > ,
194
195
}
195
196
196
- impl < SealDef : RgbSealDef < Src = SealSrc > , SealSrc : RgbSealSrc > FilePile < SealDef , SealSrc >
197
- where <SealSrc :: PubWitness as PublishedWitness < SealSrc > >:: PubId :
197
+ impl < SealDef : RgbSealDef > FilePile < SealDef >
198
+ where << SealDef :: Src as SingleUseSeal > :: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId :
198
199
Copy + Ord + From < [ u8 ; 32 ] > + Into < [ u8 ; 32 ] >
199
200
{
200
201
pub fn new ( name : & str , path : impl AsRef < Path > ) -> Self {
@@ -212,8 +213,8 @@ pub mod fs {
212
213
}
213
214
}
214
215
215
- impl < SealDef : RgbSealDef < Src = SealSrc > , SealSrc : RgbSealSrc > FilePile < SealDef , SealSrc >
216
- where <SealSrc :: PubWitness as PublishedWitness < SealSrc > >:: PubId :
216
+ impl < SealDef : RgbSealDef > FilePile < SealDef >
217
+ where << SealDef :: Src as SingleUseSeal > :: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId :
217
218
Copy + Ord + From < [ u8 ; 32 ] > + Into < [ u8 ; 32 ] >
218
219
{
219
220
pub fn open ( path : impl AsRef < Path > ) -> Self {
@@ -230,26 +231,27 @@ pub mod fs {
230
231
}
231
232
}
232
233
233
- impl < SealDef : RgbSealDef < Src = SealSrc > , SealSrc : RgbSealSrc > Pile for FilePile < SealDef , SealSrc >
234
+ impl < SealDef : RgbSealDef > Pile for FilePile < SealDef >
234
235
where
235
- SealSrc :: CliWitness : StrictEncode + StrictDecode ,
236
- SealSrc :: PubWitness : StrictEncode + StrictDecode ,
237
- <SealSrc :: PubWitness as PublishedWitness < SealSrc > >:: PubId :
236
+ < SealDef :: Src as SingleUseSeal > :: CliWitness : StrictEncode + StrictDecode ,
237
+ < SealDef :: Src as SingleUseSeal > :: PubWitness : StrictEncode + StrictDecode ,
238
+ << SealDef :: Src as SingleUseSeal > :: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId :
238
239
Copy + Ord + From < [ u8 ; 32 ] > + Into < [ u8 ; 32 ] > ,
239
240
{
240
- type SealSrc = SealSrc ;
241
241
type SealDef = SealDef ;
242
+ type SealSrc = SealDef :: Src ;
242
243
type Hoard = FileAora <
243
- <SealSrc :: PubWitness as PublishedWitness < SealSrc > >:: PubId ,
244
- SealSrc :: CliWitness ,
244
+ << Self :: SealSrc as SingleUseSeal > :: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId ,
245
+ < Self :: SealSrc as SingleUseSeal > :: CliWitness ,
245
246
> ;
246
247
type Cache = FileAora <
247
- <SealSrc :: PubWitness as PublishedWitness < SealSrc > >:: PubId ,
248
- SealSrc :: PubWitness ,
248
+ << Self :: SealSrc as SingleUseSeal > :: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId ,
249
+ < Self :: SealSrc as SingleUseSeal > :: PubWitness ,
249
250
> ;
250
251
type Keep = FileAora < Opid , SmallOrdMap < u16 , SealDef > > ;
251
- type Index =
252
- FileIndex < <<SealSrc as SingleUseSeal >:: PubWitness as PublishedWitness < SealSrc > >:: PubId > ;
252
+ type Index = FileIndex <
253
+ <<Self :: SealSrc as SingleUseSeal >:: PubWitness as PublishedWitness < SealDef :: Src > >:: PubId ,
254
+ > ;
253
255
254
256
fn hoard ( & self ) -> & Self :: Hoard { & self . hoard }
255
257
@@ -267,7 +269,10 @@ pub mod fs {
267
269
268
270
fn index_mut ( & mut self ) -> & mut Self :: Index { & mut self . index }
269
271
270
- fn retrieve ( & mut self , opid : Opid ) -> impl ExactSizeIterator < Item = SealWitness < SealSrc > > {
272
+ fn retrieve (
273
+ & mut self ,
274
+ opid : Opid ,
275
+ ) -> impl ExactSizeIterator < Item = SealWitness < SealDef :: Src > > {
271
276
self . index . get ( opid) . map ( |pubid| {
272
277
let client = self . hoard . read ( pubid) ;
273
278
let published = self . cache . read ( pubid) ;
0 commit comments