This is a so-called “marker trait”, i.e. the trait which doesn’t add any functionality directly, but rather is used as a requirement for the object to be used in certain ways.
In short, there are two such marker traits built into the compiler -
Sync. The first, if it is implemented, states that the object can be safely sent to other thread. An example of the type which is not
Rc: if we could send it to another thread, we could try to clone it in two threads at once, and this will lead to data race, since cloning
Rc involves incrementing of its internal accumulator.
Sync, states that not the object itself, but the reference to it (shared reference, of course) can be safely sent to another thread. In other words, it is safe to assume that accessing the same object from multiple threads at once won’t lead to memory unsafety or data races. Obvious example of non-
Sync object is any
Cell, since they can be modified through shared reference, and if two such references are used concurrently - the data race will occur.
In fact, I’m sure that some kind of internal buffer is implemented (for performance - reading from socket one byte at a time is highly inefficient). But it doesn’t change that much.