1
1
use super :: {
2
2
AttributesIntoIteratorV03 , AttributesIntoIteratorV10 , AttributesV03 , AttributesV10 ,
3
- ExtensionValue , SpecVersion ,
3
+ ExtensionValue , SpecVersion , UriReference ,
4
4
} ;
5
5
use chrono:: { DateTime , Utc } ;
6
6
use serde:: Serializer ;
@@ -14,7 +14,7 @@ pub enum AttributeValue<'a> {
14
14
SpecVersion ( SpecVersion ) ,
15
15
String ( & ' a str ) ,
16
16
URI ( & ' a Url ) ,
17
- URIRef ( & ' a Url ) ,
17
+ URIRef ( & ' a UriReference ) ,
18
18
Boolean ( & ' a bool ) ,
19
19
Integer ( & ' a i64 ) ,
20
20
Time ( & ' a DateTime < Utc > ) ,
@@ -49,7 +49,7 @@ pub trait AttributesReader {
49
49
/// Get the [id](https://github.com/cloudevents/spec/blob/master/spec.md#id).
50
50
fn id ( & self ) -> & str ;
51
51
/// Get the [source](https://github.com/cloudevents/spec/blob/master/spec.md#source-1).
52
- fn source ( & self ) -> & Url ;
52
+ fn source ( & self ) -> & UriReference ;
53
53
/// Get the [specversion](https://github.com/cloudevents/spec/blob/master/spec.md#specversion).
54
54
fn specversion ( & self ) -> SpecVersion ;
55
55
/// Get the [type](https://github.com/cloudevents/spec/blob/master/spec.md#type).
@@ -71,7 +71,7 @@ pub trait AttributesWriter {
71
71
fn set_id ( & mut self , id : impl Into < String > ) -> String ;
72
72
/// Set the [source](https://github.com/cloudevents/spec/blob/master/spec.md#source-1).
73
73
/// Returns the previous value.
74
- fn set_source ( & mut self , source : impl Into < Url > ) -> Url ;
74
+ fn set_source ( & mut self , source : impl Into < UriReference > ) -> UriReference ;
75
75
/// Set the [type](https://github.com/cloudevents/spec/blob/master/spec.md#type).
76
76
/// Returns the previous value.
77
77
fn set_type ( & mut self , ty : impl Into < String > ) -> String ;
@@ -126,7 +126,7 @@ impl AttributesReader for Attributes {
126
126
}
127
127
}
128
128
129
- fn source ( & self ) -> & Url {
129
+ fn source ( & self ) -> & UriReference {
130
130
match self {
131
131
Attributes :: V03 ( a) => a. source ( ) ,
132
132
Attributes :: V10 ( a) => a. source ( ) ,
@@ -184,7 +184,7 @@ impl AttributesWriter for Attributes {
184
184
}
185
185
}
186
186
187
- fn set_source ( & mut self , source : impl Into < Url > ) -> Url {
187
+ fn set_source ( & mut self , source : impl Into < UriReference > ) -> UriReference {
188
188
match self {
189
189
Attributes :: V03 ( a) => a. set_source ( source) ,
190
190
Attributes :: V10 ( a) => a. set_source ( source) ,
0 commit comments