Lattice friction for crystalline defects: from dislocations to cracks