{"id":57403,"library":"textwrap","title":"textwrap","description":"Library for word wrapping, indenting, and dedenting strings. Has optional support for Unicode and emojis as well as machine hyphenation.","status":"active","version":"0.16.2","language":"rust","source_language":null,"source_url":"https://github.com/mgeisler/textwrap","tags":["text","wrapping","indentation","unicode"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\ntextwrap = \"0.16.2\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add textwrap","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"wrap","correct":"use textwrap::wrap;"}],"quickstart":{"code":"use textwrap::wrap;\nlet wrapped = wrap(\"Hello world, this is a long line.\", 10);\nfor line in wrapped {\n    println!(\"{}\", line);\n}","lang":"rust","description":"Wrap a string to a specified width."},"warnings":[{"fix":"Add `features = [\"unicode-width\"]` to your Cargo.toml dependency.","message":"Unicode support requires the `unicode-width` feature.","severity":"gotcha","affected_versions":">=0.16.0"}],"env_vars":null,"search_vec":"'dedent':8 'emoji':16 'hyphen':21 'indent':6,24 'librari':2 'machin':20 'option':11 'string':9 'support':12 'text':22 'textwrap':1 'unicod':14,25 'well':18 'word':4 'wrap':5,23","created_at":"2026-06-16T15:41:08.962033+00:00","updated_at":"2026-06-16T15:41:08.962033+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/mgeisler/textwrap","github":"https://github.com/mgeisler/textwrap","docs":"https://docs.rs/textwrap/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}