Pull to refresh
2
0
Send message

How does Rust treat Strings and Vectors internally

Reading time4 min
Views3K

In Rust strings can be represented in two ways:

a)       String type

b)      String slice

String type:

String type is defined as a struct of the following structure:

Depending on arch (in my case x86 64bit it is 24byte)

{

   pointer to the address where string characters are stored (8b)

   capacity (8b)

   length (8b)

}

Read more
Total votes 4: ↑4 and ↓0+4
Comments0

Information

Rating
Does not participate
Registered
Activity