In Rust the xmpp-addr (docs) crate can be used to manipulate JIDs.
To split a JID into its component parts (without validating that those parts are valid), the Jid::split function may be used:
let (lp, dp, rp) = Jid::split("[email protected]")?;
assert_eq!(lp, Some("feste"));
assert_eq!(dp, "example.net");
assert_eq!(rp, None);