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]> {
24692469 }
24702470}
24712471
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+
24722485// The following methods implement mutable routines on the internal
24732486// representation of a DFA. As such, we must fix the first type parameter to a
24742487// `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]> {
10711071 }
10721072}
10731073
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+
10741087impl < T : AsRef < [ u8 ] > > fmt:: Debug for DFA < T > {
10751088 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
10761089 writeln ! ( f, "sparse::DFA(" ) ?;
You can’t perform that action at this time.
0 commit comments