pub fn create<A: ToSocketAddrs>(
		sam_addr: A,
		destination: &str,
		nickname: &str,
		style: SessionStyle,
	) -> Result<Session, Error> {
		let mut sam = SamConnection::connect(sam_addr)?;
		let create_session_msg = format!(
			"SESSION CREATE STYLE={style} ID={nickname} DESTINATION={destination} \n",
			style = style.string(),
			nickname = nickname,
			destination = destination
		);

		sam.send(create_session_msg, sam_session_status)?;

		let local_dest = sam.naming_lookup("ME")?;

		Ok(Session {
			sam: sam,
			local_dest: local_dest,
			nickname: nickname.to_string(),
		})
	}
/// Create a new session using all provided parameters
Create a new session using all provided parameters
Create a new session using all provided parameters
pub fn create<A: ToSocketAddrs>(
		sam_addr: A,
		destination: &str,
		nickname: &str,
		style: SessionStyle,
	) -> Result<Session, Error> {
		let mut sam = SamConnection::connect(sam_addr)?;
		let create_session_msg = format!(
			"SESSION CREATE STYLE={style} ID={nickname} DESTINATION={destination} \n",
			style = style.string(),
			nickname = nickname,
			destination = destination
		);
		sam.send(create_session_msg, sam_session_status)?;
		let local_dest = sam.naming_lookup("ME")?;
		Ok(Session {
			sam: sam,
			local_dest: local_dest,
			nickname: nickname.to_string(),
		})
	}
pub fn create < A : ToSocketAddrs > ( sam_addr : A , destination : & str , nickname : & str , style : SessionStyle , ) -> Result < Session , Error > { let mut sam = SamConnection :: connect ( sam_addr ) ? ; let create_session_msg = format ! ( " \n " style style string ( ) nickname nickname destination destination ) ; sam . send ( create_session_msg , sam_session_status ) ? ; let local_dest = sam . naming_lookup ( " " ) ? ; Ok ( Session { sam : sam , local_dest : local_dest , nickname : nickname . to_string ( ) , } ) }
Create a new session using all provided parameters
Create a new session using all provided parameters
sam_addr
A
destination
&str
nickname
&str
style
SessionStyle
sam_addr
A
destination
&str
nickname
&str
style
SessionStyle