aboutsummaryrefslogtreecommitdiffstats
path: root/components/net_traits/lib.rs
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2015-10-15 16:44:39 -0700
committerEli Friedman <eli.friedman@gmail.com>2015-10-15 16:44:39 -0700
commitc1aff0b678d346e5f782e06a3e1e512128fa3f05 (patch)
tree2ec208eb639fcb891285a9c1a264128fb58d23c8 /components/net_traits/lib.rs
parent9d5f09e09c64d878e6c2bb273195c3c6ca9fe82c (diff)
downloadservo-c1aff0b678d346e5f782e06a3e1e512128fa3f05.tar.gz
servo-c1aff0b678d346e5f782e06a3e1e512128fa3f05.zip
Make AsyncResponseListener methods take `&mut self`.
Diffstat (limited to 'components/net_traits/lib.rs')
-rw-r--r--components/net_traits/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs
index aa38d2a0a3f..c7b87534e85 100644
--- a/components/net_traits/lib.rs
+++ b/components/net_traits/lib.rs
@@ -163,13 +163,13 @@ pub trait AsyncFetchListener {
/// A listener for asynchronous network events. Cancelling the underlying request is unsupported.
pub trait AsyncResponseListener {
/// The response headers for a request have been received.
- fn headers_available(&self, metadata: Metadata);
+ fn headers_available(&mut self, metadata: Metadata);
/// A portion of the response body has been received. This data is unavailable after
/// this method returned, and must be stored accordingly.
- fn data_available(&self, payload: Vec<u8>);
+ fn data_available(&mut self, payload: Vec<u8>);
/// The response is complete. If the provided status is an Err value, there is no guarantee
/// that the response body was completely read.
- fn response_complete(&self, status: Result<(), String>);
+ fn response_complete(&mut self, status: Result<(), String>);
}
/// Data for passing between threads/processes to indicate a particular action to
@@ -186,7 +186,7 @@ pub enum ResponseAction {
impl ResponseAction {
/// Execute the default action on a provided listener.
- pub fn process(self, listener: &AsyncResponseListener) {
+ pub fn process(self, listener: &mut AsyncResponseListener) {
match self {
ResponseAction::HeadersAvailable(m) => listener.headers_available(m),
ResponseAction::DataAvailable(d) => listener.data_available(d),