diff --git a/google-apis-common/src/lib.rs b/google-apis-common/src/lib.rs index 3540fc9b46..65339071f1 100644 --- a/google-apis-common/src/lib.rs +++ b/google-apis-common/src/lib.rs @@ -793,7 +793,7 @@ pub async fn get_body_as_string(res_body: &mut hyper::Body) -> String { // TODO: Simplify this to Option type TokenResult = std::result::Result, oauth2::Error>; -pub trait GetToken: GetTokenClone { +pub trait GetToken: GetTokenClone + Send { /// Called whenever there is the need for an oauth token after /// the official authenticator implementation didn't provide one, for some reason. /// If this method returns None as well, the underlying operation will fail @@ -928,4 +928,13 @@ mod test_api { let dlg: &mut dyn Delegate = &mut dd; with_send(dlg); } + + #[test] + fn dyn_get_token_is_send() { + fn with_send(_x: impl Send) {} + + let mut gt = String::new(); + let dgt: &mut dyn GetToken = &mut dd; + with_send(dgt); + } }