File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2469,6 +2469,19 @@ impl<'a> DFA<&'a [u32]> {
2469
2469
}
2470
2470
}
2471
2471
2472
+ /// Other routines that work for all `T`.
2473
+ impl < T > DFA < T > {
2474
+ /// Set or unset the prefilter attached to this DFA.
2475
+ ///
2476
+ /// This is useful when one has deserialized a DFA from `&[u8]`.
2477
+ /// Deserialization does not currently include prefilters, so if you
2478
+ /// want prefilter acceleration, you'll need to rebuild it and attach
2479
+ /// it here.
2480
+ pub fn set_prefilter ( & mut self , prefilter : Option < Prefilter > ) {
2481
+ self . pre = prefilter
2482
+ }
2483
+ }
2484
+
2472
2485
// The following methods implement mutable routines on the internal
2473
2486
// representation of a DFA. As such, we must fix the first type parameter to a
2474
2487
// `Vec<u32>` since a generic `T: AsRef<[u32]>` does not permit mutation. We
Original file line number Diff line number Diff line change @@ -1071,6 +1071,19 @@ impl<'a> DFA<&'a [u8]> {
1071
1071
}
1072
1072
}
1073
1073
1074
+ /// Other routines that work for all `T`.
1075
+ impl < T > DFA < T > {
1076
+ /// Set or unset the prefilter attached to this DFA.
1077
+ ///
1078
+ /// This is useful when one has deserialized a DFA from `&[u8]`.
1079
+ /// Deserialization does not currently include prefilters, so if you
1080
+ /// want prefilter acceleration, you'll need to rebuild it and attach
1081
+ /// it here.
1082
+ pub fn set_prefilter ( & mut self , prefilter : Option < Prefilter > ) {
1083
+ self . pre = prefilter
1084
+ }
1085
+ }
1086
+
1074
1087
impl < T : AsRef < [ u8 ] > > fmt:: Debug for DFA < T > {
1075
1088
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1076
1089
writeln ! ( f, "sparse::DFA(" ) ?;
You can’t perform that action at this time.
0 commit comments