@@ -17,9 +17,7 @@ pub const NEXT_CHANNEL_SEQUENCE: &str = "nextChannelSequence";
17
17
18
18
pub const EUREKA : & str = "eureka" ;
19
19
pub const SOURCE_CLIENT_ON_TARGET : & str = "sourceClientOnTarget" ;
20
- pub const SOURCE_PREFIX : & str = "sourcePrefix" ;
21
20
pub const TARGET_CLIENT_ON_SOURCE : & str = "targetClientOnSource" ;
22
- pub const TARGET_PREFIX : & str = "targetPrefix" ;
23
21
24
22
pub const CLIENT_PREFIX : & str = "clients" ;
25
23
pub const CLIENT_STATE : & str = "clientState" ;
@@ -515,27 +513,18 @@ impl SeqSendPath {
515
513
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
516
514
#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Display ) ]
517
515
#[ display(
518
- fmt = "{EUREKA}/{NEXT_SEQ_SEND_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{SOURCE_PREFIX}/{source_prefix}/{ TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{TARGET_PREFIX}/{target_prefix }"
516
+ fmt = "{EUREKA}/{NEXT_SEQ_SEND_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}"
519
517
) ]
520
518
pub struct SeqSendPathV2 {
521
519
pub source_client_on_target : ClientId ,
522
- pub source_prefix : String ,
523
520
pub target_client_on_source : ClientId ,
524
- pub target_prefix : String ,
525
521
}
526
522
527
523
impl SeqSendPathV2 {
528
- pub fn new (
529
- source_client_on_target : & ClientId ,
530
- source_prefix : & str ,
531
- target_client_on_source : & ClientId ,
532
- target_prefix : & str ,
533
- ) -> Self {
524
+ pub fn new ( source_client_on_target : & ClientId , target_client_on_source : & ClientId ) -> Self {
534
525
Self {
535
526
source_client_on_target : source_client_on_target. clone ( ) ,
536
- source_prefix : source_prefix. to_string ( ) ,
537
527
target_client_on_source : target_client_on_source. clone ( ) ,
538
- target_prefix : target_prefix. to_string ( ) ,
539
528
}
540
529
}
541
530
}
@@ -578,27 +567,18 @@ impl SeqRecvPath {
578
567
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
579
568
#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Display ) ]
580
569
#[ display(
581
- fmt = "{EUREKA}/{NEXT_SEQ_RECV_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{SOURCE_PREFIX}/{source_prefix}/{ TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{TARGET_PREFIX}/{target_prefix }"
570
+ fmt = "{EUREKA}/{NEXT_SEQ_RECV_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}"
582
571
) ]
583
572
pub struct SeqRecvPathV2 {
584
573
pub source_client_on_target : ClientId ,
585
- pub source_prefix : String ,
586
574
pub target_client_on_source : ClientId ,
587
- pub target_prefix : String ,
588
575
}
589
576
590
577
impl SeqRecvPathV2 {
591
- pub fn new (
592
- source_client_on_target : & ClientId ,
593
- source_prefix : & str ,
594
- target_client_on_source : & ClientId ,
595
- target_prefix : & str ,
596
- ) -> Self {
578
+ pub fn new ( source_client_on_target : & ClientId , target_client_on_source : & ClientId ) -> Self {
597
579
Self {
598
580
source_client_on_target : source_client_on_target. clone ( ) ,
599
- source_prefix : source_prefix. to_string ( ) ,
600
581
target_client_on_source : target_client_on_source. clone ( ) ,
601
- target_prefix : target_prefix. to_string ( ) ,
602
582
}
603
583
}
604
584
}
@@ -641,27 +621,18 @@ impl SeqAckPath {
641
621
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
642
622
#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Display ) ]
643
623
#[ display(
644
- fmt = "{EUREKA}/{NEXT_SEQ_ACK_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{SOURCE_PREFIX}/{source_prefix}/{ TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{TARGET_PREFIX}/{target_prefix }"
624
+ fmt = "{EUREKA}/{NEXT_SEQ_ACK_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}"
645
625
) ]
646
626
pub struct SeqAckPathV2 {
647
627
pub source_client_on_target : ClientId ,
648
- pub source_prefix : String ,
649
628
pub target_client_on_source : ClientId ,
650
- pub target_prefix : String ,
651
629
}
652
630
653
631
impl SeqAckPathV2 {
654
- pub fn new (
655
- source_client_on_target : & ClientId ,
656
- source_prefix : & str ,
657
- target_client_on_source : & ClientId ,
658
- target_prefix : & str ,
659
- ) -> Self {
632
+ pub fn new ( source_client_on_target : & ClientId , target_client_on_source : & ClientId ) -> Self {
660
633
Self {
661
634
source_client_on_target : source_client_on_target. clone ( ) ,
662
- source_prefix : source_prefix. to_string ( ) ,
663
635
target_client_on_source : target_client_on_source. clone ( ) ,
664
- target_prefix : target_prefix. to_string ( ) ,
665
636
}
666
637
}
667
638
}
@@ -720,29 +691,25 @@ impl CommitmentPath {
720
691
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
721
692
#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Display ) ]
722
693
#[ display(
723
- fmt = "{EUREKA}/{PACKET_COMMITMENT_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{SOURCE_PREFIX}/{source_prefix}/{ TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{TARGET_PREFIX}/{target_prefix }/{SEQUENCE_PREFIX}/{sequence}"
694
+ fmt = "{EUREKA}/{PACKET_COMMITMENT_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{SEQUENCE_PREFIX}/{sequence}"
724
695
) ]
725
696
pub struct CommitmentPathV2 {
726
697
pub source_client_on_target : ClientId ,
727
- pub source_prefix : String ,
698
+
728
699
pub target_client_on_source : ClientId ,
729
- pub target_prefix : String ,
700
+
730
701
pub sequence : Sequence ,
731
702
}
732
703
733
704
impl CommitmentPathV2 {
734
705
pub fn new (
735
706
source_client_on_target : & ClientId ,
736
- source_prefix : & str ,
737
707
target_client_on_source : & ClientId ,
738
- target_prefix : & str ,
739
708
sequence : & Sequence ,
740
709
) -> Self {
741
710
Self {
742
711
source_client_on_target : source_client_on_target. clone ( ) ,
743
- source_prefix : source_prefix. to_string ( ) ,
744
712
target_client_on_source : target_client_on_source. clone ( ) ,
745
- target_prefix : target_prefix. to_string ( ) ,
746
713
sequence : * sequence,
747
714
}
748
715
}
@@ -808,29 +775,23 @@ impl AckPath {
808
775
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
809
776
#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Display ) ]
810
777
#[ display(
811
- fmt = "{EUREKA}/{PACKET_ACK_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{SOURCE_PREFIX}/{source_prefix}/{ TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{TARGET_PREFIX}/{target_prefix }/{SEQUENCE_PREFIX}/{sequence}"
778
+ fmt = "{EUREKA}/{PACKET_ACK_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{SEQUENCE_PREFIX}/{sequence}"
812
779
) ]
813
780
pub struct AckPathV2 {
814
781
pub source_client_on_target : ClientId ,
815
- pub source_prefix : String ,
816
782
pub target_client_on_source : ClientId ,
817
- pub target_prefix : String ,
818
783
pub sequence : Sequence ,
819
784
}
820
785
821
786
impl AckPathV2 {
822
787
pub fn new (
823
788
source_client_on_target : & ClientId ,
824
- source_prefix : & str ,
825
789
target_client_on_source : & ClientId ,
826
- target_prefix : & str ,
827
790
sequence : & Sequence ,
828
791
) -> Self {
829
792
Self {
830
793
source_client_on_target : source_client_on_target. clone ( ) ,
831
- source_prefix : source_prefix. to_string ( ) ,
832
794
target_client_on_source : target_client_on_source. clone ( ) ,
833
- target_prefix : target_prefix. to_string ( ) ,
834
795
sequence : * sequence,
835
796
}
836
797
}
@@ -896,29 +857,23 @@ impl ReceiptPath {
896
857
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
897
858
#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Display ) ]
898
859
#[ display(
899
- fmt = "{EUREKA}/{PACKET_RECEIPT_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{SOURCE_PREFIX}/{source_prefix}/{ TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{TARGET_PREFIX}/{target_prefix }/{SEQUENCE_PREFIX}/{sequence}"
860
+ fmt = "{EUREKA}/{PACKET_RECEIPT_PREFIX}/{SOURCE_CLIENT_ON_TARGET}/{source_client_on_target}/{TARGET_CLIENT_ON_SOURCE}/{target_client_on_source}/{SEQUENCE_PREFIX}/{sequence}"
900
861
) ]
901
862
pub struct ReceiptPathV2 {
902
863
pub source_client_on_target : ClientId ,
903
- pub source_prefix : String ,
904
864
pub target_client_on_source : ClientId ,
905
- pub target_prefix : String ,
906
865
pub sequence : Sequence ,
907
866
}
908
867
909
868
impl ReceiptPathV2 {
910
869
pub fn new (
911
870
source_client_on_target : & ClientId ,
912
- source_prefix : & str ,
913
871
target_client_on_source : & ClientId ,
914
- target_prefix : & str ,
915
872
sequence : & Sequence ,
916
873
) -> Self {
917
874
Self {
918
875
source_client_on_target : source_client_on_target. clone ( ) ,
919
- source_prefix : source_prefix. to_string ( ) ,
920
876
target_client_on_source : target_client_on_source. clone ( ) ,
921
- target_prefix : target_prefix. to_string ( ) ,
922
877
sequence : * sequence,
923
878
}
924
879
}
@@ -1357,15 +1312,13 @@ fn parse_receipts(components: &[&str]) -> Option<Path> {
1357
1312
}
1358
1313
1359
1314
fn parse_commit_ack_receipt_seqs_v2 ( components : & [ & str ] ) -> Option < Path > {
1360
- if components. len ( ) != 10 {
1315
+ if components. len ( ) != 6 {
1361
1316
return None ;
1362
1317
}
1363
1318
1364
1319
if !( components[ 0 ] == EUREKA
1365
1320
&& components[ 2 ] == SOURCE_CLIENT_ON_TARGET
1366
- && components[ 4 ] == SOURCE_PREFIX
1367
- && components[ 6 ] == TARGET_CLIENT_ON_SOURCE
1368
- && components[ 8 ] == TARGET_PREFIX )
1321
+ && components[ 4 ] == TARGET_CLIENT_ON_SOURCE )
1369
1322
{
1370
1323
return None ;
1371
1324
}
@@ -1378,53 +1331,31 @@ fn parse_commit_ack_receipt_seqs_v2(components: &[&str]) -> Option<Path> {
1378
1331
}
1379
1332
1380
1333
let source_client_on_target = ClientId :: from_str ( components[ 3 ] ) . ok ( ) ?;
1381
- let source_prefix = components[ 5 ] ;
1382
- let target_client_on_source = ClientId :: from_str ( components[ 7 ] ) . ok ( ) ?;
1383
- let target_prefix = components[ 9 ] ;
1334
+ let target_client_on_source = ClientId :: from_str ( components[ 5 ] ) . ok ( ) ?;
1384
1335
1385
1336
match components[ 1 ] {
1386
- NEXT_SEQ_SEND_PREFIX => Some (
1387
- SeqSendPathV2 :: new (
1388
- & source_client_on_target,
1389
- source_prefix,
1390
- & target_client_on_source,
1391
- target_prefix,
1392
- )
1393
- . into ( ) ,
1394
- ) ,
1395
- NEXT_SEQ_RECV_PREFIX => Some (
1396
- SeqRecvPathV2 :: new (
1397
- & source_client_on_target,
1398
- source_prefix,
1399
- & target_client_on_source,
1400
- target_prefix,
1401
- )
1402
- . into ( ) ,
1403
- ) ,
1404
- NEXT_SEQ_ACK_PREFIX => Some (
1405
- SeqAckPathV2 :: new (
1406
- & source_client_on_target,
1407
- source_prefix,
1408
- & target_client_on_source,
1409
- target_prefix,
1410
- )
1411
- . into ( ) ,
1412
- ) ,
1337
+ NEXT_SEQ_SEND_PREFIX => {
1338
+ Some ( SeqSendPathV2 :: new ( & source_client_on_target, & target_client_on_source) . into ( ) )
1339
+ }
1340
+ NEXT_SEQ_RECV_PREFIX => {
1341
+ Some ( SeqRecvPathV2 :: new ( & source_client_on_target, & target_client_on_source) . into ( ) )
1342
+ }
1343
+ NEXT_SEQ_ACK_PREFIX => {
1344
+ Some ( SeqAckPathV2 :: new ( & source_client_on_target, & target_client_on_source) . into ( ) )
1345
+ }
1413
1346
_ => None ,
1414
1347
}
1415
1348
}
1416
1349
1417
1350
fn parse_commit_ack_receipt_v2 ( components : & [ & str ] ) -> Option < Path > {
1418
- if components. len ( ) != 12 {
1351
+ if components. len ( ) != 8 {
1419
1352
return None ;
1420
1353
}
1421
1354
1422
1355
if !( components[ 0 ] == EUREKA
1423
1356
&& components[ 2 ] == SOURCE_CLIENT_ON_TARGET
1424
- && components[ 4 ] == SOURCE_PREFIX
1425
- && components[ 6 ] == TARGET_CLIENT_ON_SOURCE
1426
- && components[ 8 ] == TARGET_PREFIX
1427
- && components[ 10 ] == SEQUENCE_PREFIX )
1357
+ && components[ 4 ] == TARGET_CLIENT_ON_SOURCE
1358
+ && components[ 6 ] == SEQUENCE_PREFIX )
1428
1359
{
1429
1360
return None ;
1430
1361
}
@@ -1437,38 +1368,30 @@ fn parse_commit_ack_receipt_v2(components: &[&str]) -> Option<Path> {
1437
1368
}
1438
1369
1439
1370
let source_client_on_target = ClientId :: from_str ( components[ 3 ] ) . ok ( ) ?;
1440
- let source_prefix = components[ 5 ] ;
1441
- let target_client_on_source = ClientId :: from_str ( components[ 7 ] ) . ok ( ) ?;
1442
- let target_prefix = components[ 9 ] ;
1443
- let sequence = Sequence :: from_str ( components[ 11 ] ) . ok ( ) ?;
1371
+ let target_client_on_source = ClientId :: from_str ( components[ 5 ] ) . ok ( ) ?;
1372
+ let sequence = Sequence :: from_str ( components[ 7 ] ) . ok ( ) ?;
1444
1373
1445
1374
match components[ 1 ] {
1446
1375
PACKET_COMMITMENT_PREFIX => Some (
1447
1376
CommitmentPathV2 :: new (
1448
1377
& source_client_on_target,
1449
- source_prefix,
1450
1378
& target_client_on_source,
1451
- target_prefix,
1452
1379
& sequence,
1453
1380
)
1454
1381
. into ( ) ,
1455
1382
) ,
1456
1383
PACKET_ACK_PREFIX => Some (
1457
1384
AckPathV2 :: new (
1458
1385
& source_client_on_target,
1459
- source_prefix,
1460
1386
& target_client_on_source,
1461
- target_prefix,
1462
1387
& sequence,
1463
1388
)
1464
1389
. into ( ) ,
1465
1390
) ,
1466
1391
PACKET_RECEIPT_PREFIX => Some (
1467
1392
ReceiptPathV2 :: new (
1468
1393
& source_client_on_target,
1469
- source_prefix,
1470
1394
& target_client_on_source,
1471
- target_prefix,
1472
1395
& sequence,
1473
1396
)
1474
1397
. into ( ) ,
0 commit comments