Formal theory of electronic stopping of channeled ions