There are three major types of muscles injuries: contusion, strain, or laceration. Contusion is caused by a direct and compressive force such as a direct blow. Muscle strain is more often the result of tensile force (tension) beyond what the muscle can stretch. And of course, a laceration or cut is the result of sharp trauma through the skin and fascia down to the muscle.
Strains are more common in muscles like the hamstrings that cross two different joints (in this case, the hip and the knee). Certain joint positions can put maximum strain on a muscle that is affected by two joints versus a muscle that is only affected by one joint.
You didn’t describe your injury but if it was one where you stretched the hamstring beyond its resting length, then you may very well have strained it. Full tears or ruptures cause the muscle to snap back away from the bone where it was attached. This separation is referred to as a retraction.
Most of the time, a full rupture with retraction will produce a ball of soft tissue somewhere along the muscle. You will also be more likely to lose strength and motion when the muscle is completely torn. The best way to find out is to see a physician for a full evaluation. Clinical exam may be all that’s needed to make the diagnosis. Imaging studies such as MRI or ultrasound may be ordered to confirm the diagnosis and to map out the full extent of the injury for treatment purposes.