What is the interface for abstract types in Base?

Julia has a well-defined interface for AbstractArray related in the documentation, however, I have difficulty finding interface for:

  • AbstractString: displaying it requires ncodeunits(s::SomeString), iterate(s::SomeString, i::Integer), are there more?
  • AbstractVector: the size of vectors can be modified in Julia, I can do that with push[first]!, pop[first]!, etc, are there more methods to support?

Regarding your second example: I don’t know what Julia’s official definitions are here, but I should point out, that there are also sized arrays, like StaticArrays for instance.
Consider this example:

julia> test!(x::AbstractVector) = push!(x,0)
test! (generic function with 1 method)
julia> using StaticArrays; test!(SVector(3,2,1))
ERROR: MethodError: no method matching resize!(::SVector{3, Int64}, ::Int64)

In general I guess this is one of the downsides of multiple dispatch, if you make the definition for an abstract type too loose, you end up with such kind of errors, on the other hand if you make the definitions too rigorous then you lose a lot of flexibility…

Yes, resizing is certainly not universal, you don’t have to go that far, a lot of AbstractVector subtypes are just wrapper for external data:

A = [1,2,3]
B = unsafe_wrap(Array, pointer(A), 3)
push!(B, 4) # error