@@ -31,28 +31,28 @@ impl AnnotationStore {
3131 ///
3232 /// The item is returned as a fat pointer [`ResultItem<TextResource>`]) in an Option.
3333 /// Returns `None` if it does not exist.
34- pub fn resource (
35- & self ,
34+ pub fn resource < ' a > (
35+ & ' a self ,
3636 request : impl Request < TextResource > ,
37- ) -> Option < ResultItem < TextResource > > {
37+ ) -> Option < ResultItem < ' a , TextResource > > {
3838 self . get ( request) . map ( |x| x. as_resultitem ( self , self ) ) . ok ( )
3939 }
4040
4141 /// Requests a specific [`AnnotationDataSet`] from the store to be returned by reference.
4242 /// The `request` parameter encapsulates some kind of identifier, it can be a `&str`, [`String`] or [`AnnotationDataSetHandle`].
43- pub fn dataset (
44- & self ,
43+ pub fn dataset < ' a > (
44+ & ' a self ,
4545 request : impl Request < AnnotationDataSet > ,
46- ) -> Option < ResultItem < AnnotationDataSet > > {
46+ ) -> Option < ResultItem < ' a , AnnotationDataSet > > {
4747 self . get ( request) . map ( |x| x. as_resultitem ( self , self ) ) . ok ( )
4848 }
4949
5050 /// Requests a specific [`DataKey`] (pertaining to an [`AnnotationDataSet`]) to be returned by reference.
51- pub fn key (
52- & self ,
51+ pub fn key < ' a > (
52+ & ' a self ,
5353 set : impl Request < AnnotationDataSet > ,
5454 key : impl Request < DataKey > ,
55- ) -> Option < ResultItem < DataKey > > {
55+ ) -> Option < ResultItem < ' a , DataKey > > {
5656 if let Some ( dataset) = self . dataset ( set) {
5757 dataset. key ( key)
5858 } else {
@@ -61,11 +61,11 @@ impl AnnotationStore {
6161 }
6262
6363 /// Requests a specific [`AnnotationData`] (pertaining to an [`AnnotationDataSet`]) to be returned by reference.
64- pub fn annotationdata (
65- & self ,
64+ pub fn annotationdata < ' a > (
65+ & ' a self ,
6666 set : impl Request < AnnotationDataSet > ,
6767 data : impl Request < AnnotationData > ,
68- ) -> Option < ResultItem < AnnotationData > > {
68+ ) -> Option < ResultItem < ' a , AnnotationData > > {
6969 if let Some ( dataset) = self . dataset ( set) {
7070 dataset. annotationdata ( data)
7171 } else {
@@ -74,11 +74,11 @@ impl AnnotationStore {
7474 }
7575
7676 /// Requests a specific [`TextSelection`] by handle (pertaining to an [`AnnotationDataSet`]) to be returned by reference.
77- pub fn textselection (
78- & self ,
77+ pub fn textselection < ' a > (
78+ & ' a self ,
7979 resource : impl Request < TextResource > ,
8080 handle : TextSelectionHandle ,
81- ) -> Option < ResultTextSelection > {
81+ ) -> Option < ResultTextSelection < ' a > > {
8282 if let Some ( resource) = self . resource ( resource) {
8383 resource. textselection_by_handle ( handle) . ok ( )
8484 } else {
@@ -92,16 +92,19 @@ impl AnnotationStore {
9292 /// The item is returned as a fat pointer [`ResultItem<Annotation>`]),
9393 /// which exposes the high-level API, in an Option.
9494 /// Returns `None` if it does not exist.
95- pub fn annotation ( & self , request : impl Request < Annotation > ) -> Option < ResultItem < Annotation > > {
95+ pub fn annotation < ' a > (
96+ & ' a self ,
97+ request : impl Request < Annotation > ,
98+ ) -> Option < ResultItem < ' a , Annotation > > {
9699 self . get ( request) . map ( |x| x. as_resultitem ( self , self ) ) . ok ( )
97100 }
98101
99102 /// Requests a specific [`AnnotationSubStore`] from the store to be returned by reference.
100103 /// The `request` parameter encapsulates some kind of identifier, it can be a `&str`, [`String`] or [`AnnotationSubStoreHandle`].
101- pub fn substore (
102- & self ,
104+ pub fn substore < ' a > (
105+ & ' a self ,
103106 request : impl Request < AnnotationSubStore > ,
104- ) -> Option < ResultItem < AnnotationSubStore > > {
107+ ) -> Option < ResultItem < ' a , AnnotationSubStore > > {
105108 self . get ( request) . map ( |x| x. as_resultitem ( self , self ) ) . ok ( )
106109 }
107110
0 commit comments