How is a cracked rib treated?

Rib fracture. Rib fractures are usually treated conservatively and there is no specific cast. This mostly means pain control. Some people use braces but they are of questionable clinical value. Most fracture heal spontaneously without any problems.
Rest. Pain relief an elastic binder can help take it slow be patient it wil heal and stop hurting 6 weeks no way to speed it up.