== Why is this an issue? 

``++io::Write::write(_vectored)++`` and ``++io::Read::read(_vectored)++`` do not guarantee processing the entire buffer, which might lead to only partial writes/reads. This can result in bugs if not handled appropriately. Instead, use ``++write_all++`` or ``++read_exact++`` methods that ensure the whole buffer is processed, providing more reliable code especially in asynchronous contexts.

=== Code examples

==== Noncompliant code example

[source,rust,diff-id=1,diff-type=noncompliant]
----
use std::io;
fn foo<W: io::Write>(w: &mut W) -> io::Result<()> {
    w.write(b"foo")?; // Noncompliant: This might not write the entire buffer.
    Ok(())
}

fn bar<R: io::Read>(r: &mut R, buffer: &mut [u8]) -> io::Result<()> {
    r.read(buffer)?; // Noncompliant: This might not read the entire buffer.
    Ok(())
}
----

==== Compliant solution

[source,rust,diff-id=1,diff-type=compliant]
----
use std::io;
fn foo<W: io::Write>(w: &mut W) -> io::Result<()> {
    w.write_all(b"foo")?; // Compliant: This writes the entire buffer.
    Ok(())
}

fn bar<R: io::Read>(r: &mut R, buffer: &mut [u8]) -> io::Result<()> {
    r.read_exact(buffer)?; // Compliant: This reads the entire buffer.
    Ok(())
}
----

== Resources
=== Documentation

* Clippy Lints - https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
