From 2cbe76c64fcf6b4a3afc84a3ee2ce26676621211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 15 May 2016 18:26:17 +0300 Subject: [PATCH] Implement and require Sync+Send for sinks --- src/rsfilesink.rs | 3 +++ src/rssink.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rsfilesink.rs b/src/rsfilesink.rs index e690ce67..dcd2e3b2 100644 --- a/src/rsfilesink.rs +++ b/src/rsfilesink.rs @@ -14,6 +14,9 @@ pub struct FileSink { position: u64, } +unsafe impl Sync for FileSink {} +unsafe impl Send for FileSink {} + impl FileSink { fn new() -> FileSink { FileSink { location: None, file: None, position: 0 } diff --git a/src/rssink.rs b/src/rssink.rs index 9f871cf7..9a084488 100644 --- a/src/rssink.rs +++ b/src/rssink.rs @@ -5,7 +5,7 @@ use std::ptr; use utils::*; -pub trait Sink { +pub trait Sink: Sync + Send { fn set_uri(&mut self, uri_str: &Option) -> bool; fn get_uri(&self) -> Option; fn start(&mut self) -> bool;