[][src]Function twitchchat::register

pub async fn register<'_, '_, W: ?Sized>(
    user_config: &'_ UserConfig,
    writer: &'_ mut W
) -> Result<()> where
    W: AsyncWrite + Unpin + Send

Write the provided UserConfig to the async writer

Example

Write it to a TcpStream

let config = UserConfig::builder().anonymous().build()?;

let mut writer = vec![]; // or any type that impls AsyncWrite
register(&config, &mut writer).await?;

assert_eq!(
    std::str::from_utf8(&writer)?,
    "PASS justinfan1234\r\nNICK justinfan1234\r\n"
);