fn write(&self, languageId: Option<&str>, message: &str) -> Result<()> {
        if let Some(languageId) = languageId {
            self.update(|state| {
                let writer = state
                    .writers
                    .get_mut(languageId)
                    .ok_or(LCError::NoLanguageServer {
                        languageId: languageId.to_owned(),
                    })?;
                write!(
                    writer,
                    "Content-Length: {}\r\n\r\n{}",
                    message.len(),
                    message
                )?;
                writer.flush()?;
                Ok(())
            })?;
        } else {
            println!("Content-Length: {}\n\n{}", message.len(), message);
        }

        Ok(())
    }
/// Send message to RPC server.
Send message to RPC server.
Send message to RPC server .
fn write(&self, languageId: Option<&str>, message: &str) -> Result<()> {
        if let Some(languageId) = languageId {
            self.update(|state| {
                let writer = state
                    .writers
                    .get_mut(languageId)
                    .ok_or(LCError::NoLanguageServer {
                        languageId: languageId.to_owned(),
                    })?;
                write!(
                    writer,
                    "Content-Length: {}\r\n\r\n{}",
                    message.len(),
                    message
                )?;
                writer.flush()?;
                Ok(())
            })?;
        } else {
            println!("Content-Length: {}\n\n{}", message.len(), message);
        }
        Ok(())
    }
fn write ( & self , languageId : Option < & str > , message : & str ) -> Result < ( ) > { if let Some ( languageId ) = languageId { self . update ( | state | { let writer = state . writers . get_mut ( languageId ) . ok_or ( LCError :: NoLanguageServer { languageId : languageId . to_owned ( ) , } ) ? ; write ! ( writer " \r \n \r \n " message len ( ) message ) ? ; writer . flush ( ) ? ; Ok ( ( ) ) } ) ? ; } else { println ! ( " \n \n " message len ( ) message ) ; } Ok ( ( ) ) }
Send message to RPC server.
Send message to RPC server .
&self
languageId
Option<&str>
message
&str
&self
languageId
Option<&str>
message
&str