pub struct Service<T> { /* private fields */ }
Expand description
Turn service.
Implementations§
Source§impl<T> Service<T>
impl<T> Service<T>
pub fn get_sessions(&self) -> Arc<Sessions<T>>
Sourcepub fn new(
software: String,
realm: String,
interfaces: Vec<SocketAddr>,
observer: T,
) -> Self
pub fn new( software: String, realm: String, interfaces: Vec<SocketAddr>, observer: T, ) -> Self
Create turn service.
§Test
use turn_server::turn::*;
#[derive(Clone)]
struct ObserverTest;
impl Observer for ObserverTest {}
Service::new("test".to_string(), "test".to_string(), vec![], ObserverTest);
Sourcepub fn get_operationer(
&self,
endpoint: SocketAddr,
interface: SocketAddr,
) -> Operationer<T>
pub fn get_operationer( &self, endpoint: SocketAddr, interface: SocketAddr, ) -> Operationer<T>
Get operationer.
§Test
use std::net::SocketAddr;
use turn_server::stun::attribute::Transport;
use turn_server::turn::*;
#[derive(Clone)]
struct ObserverTest;
impl Observer for ObserverTest {}
let addr = "127.0.0.1:8080".parse::<SocketAddr>().unwrap();
let service = Service::new(
"test".to_string(),
"test".to_string(),
vec![],
ObserverTest,
);
service.get_operationer(addr, addr);
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Service<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Service<T>
impl<T> Send for Service<T>
impl<T> Sync for Service<T>
impl<T> Unpin for Service<T>where
T: Unpin,
impl<T> !UnwindSafe for Service<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more