pub struct Service { /* private fields */ }
Expand description
TUTN service.
Implementations§
Source§impl Service
impl Service
pub fn get_router(&self) -> &Arc<Router>
Sourcepub fn new<T>(realm: String, externals: Vec<SocketAddr>, observer: T) -> Selfwhere
T: Observer + 'static,
pub fn new<T>(realm: String, externals: Vec<SocketAddr>, observer: T) -> Selfwhere
T: Observer + 'static,
Create turn service.
§Examples
use turn_rs::*;
struct ObserverTest;
impl Observer for ObserverTest {}
Service::new("test".to_string(), vec![], ObserverTest);
Sourcepub fn get_processor(
&self,
interface: SocketAddr,
external: SocketAddr,
) -> Processor
pub fn get_processor( &self, interface: SocketAddr, external: SocketAddr, ) -> Processor
Get processor.
§Examples
use std::net::SocketAddr;
use turn_rs::*;
struct ObserverTest;
impl Observer for ObserverTest {}
let addr = "127.0.0.1:8080".parse::<SocketAddr>().unwrap();
let service = Service::new("test".to_string(), vec![], ObserverTest);
service.get_processor(addr, addr);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Service
impl !RefUnwindSafe for Service
impl Send for Service
impl Sync for Service
impl Unpin for Service
impl !UnwindSafe for Service
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more