Yes, thank you that should work since both libs L1, L2 and main can all refer to Either<A, B>.
This parallels a similar solution to the nominal sum types I ended up making for Java (Either<A, B>, Option3<A, B, C>, etc) with these generic types in a common shared library and other libraries and consumers of both accessing the shared type.
One more question: In Rust is Either<A, B> type-erased, specializations generated, or something else?