Quantization of Edge Currents along Magnetic Barriers and Magnetic Guides